Even Geeks have historic landmarks

XMLHttpRequest, ReadyState and IE

So I was checking out the site and looking to see what new landmarks were entered.  It was then that I noticed that my paging links were not appearing in IE when the page loaded.  If I rated a landmark, then the script would run properly.  Through some investigation, I determined that my script that pulls record counts was not returning results quick enough for IE.  So the function gave up and continued on.  However, when I added an alert box for debugging, that gave the record count script enough time to finish running. 

I did some research and learned of the asynchronous flag for the XMLHTTPRequest.open method.  False tells the rest of the code to not wait on it to run.  True tells the code that it is the center of the universe and everything must wait on it.  Now if the page you are requesting is down then this could cause problems.  But since I only need my script to wait an extra couple milliseconds I should be ok.  In addition, the page I’m requesting is on my server so if it fails to return a result then I have bigger issues than just a script taking too long.

It was also during this that I found out that once you navigated through the results the URL for the A letter pin came out as ʊ instead A.  So I browsed the code and determined when I reset the counting variable I set it as a string instead of a number.  I took out the two apostrophes and everything works fine now.

Well, I’m leaving the office and going to take a long ride on Trinity Trails.  I’ve been sitting down for extended periods of time the last couple of days and my body is craving exercise.

May 9th, 2008 at 1:44 pm


Leave a Reply

You must be logged in to post a comment.