Jump to content
Larry Ullman's Book Forums

Ajax Is Null


Recommended Posts

I'm trying to work with ajax, and got stumped for very first example of testing a simple text file through ajax.

My script in FireFox 11 says, "ajax is null". Network monitor in Firebug shows "0 requests" for url when I load my html file and click the button to show text file.

In IE 9 says, "Automation server can't create object".

 

I'm using IIS 7 as my web server, on Windows 7. It has to do something with this? I think FF, IE 9 and google Chrome supports ajax. Are there any options to disable/enable ajax support? I have enabled javascript in FF, and IE prompts whether to allow javascript.

Link to comment
Share on other sites

All modern browsers (and even most older browsers still in use today) automatically support Ajax. You shouldn't have to change any settings to enable it. If JS works, then Ajax works too.

 

Before you get too far ahead of yourself though, the first step should be to create a valid Ajax object for all browsers that support Ajax. I don't recall if Larry talks about this in this JS book, but he definitely does in his Ajax book. Also, there are tons of similar examples available online.

 

The basic premise is that you have to figure out which Ajax object constructor is valid in a given browser. In general, there is one valid constructor used for all non-IE browsers, and then another constructor with two main arguments for IE browsers. You should test all three of these, and if none of them are valid in the given browser, then Ajax is not supported in that browser, which again, nowadays, is very unlikely.

 

Please either check out Larry's Ajax book or an online resource for exact details.

 

Once you have a valid Ajax object being created for all browsers, then you should move onto the next step of actually making Ajax requests, etc.

  • Upvote 1
Link to comment
Share on other sites

Again, HartleySan you'r right. I had a typo error somewhere in ajax constructor, which was the problem. It took enough time of me to see that error.

 

Second, Larry has explained ajax in great detail in his new JS book. And he is explaining it with good examples.

Link to comment
Share on other sites

 Share

×
×
  • Create New...