ala888 Posted July 26, 2014 Share Posted July 26, 2014 So I tried implementing ajax by using a lambda function - failing horribly. Why can I not pass into the onreadystatechange property a callback function that behaves in a similar manner to that of one that is passed as an argument? Is this some sort of syntax of JS that I am not aware of ? alert(function(){return "Hello!";});//worksXMLHttpRequestObject.onreadystatechange = function(){alert("hello";)};//does not work Link to comment Share on other sites More sharing options...
ala888 Posted July 26, 2014 Author Share Posted July 26, 2014 nvm, I solved it! I was missing some brackets Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now