Weird Thoughts From Eric's Head

Tags - Categories : All | AJAX | BUSINESS | PERSONAL | PROGRAMMING | BOOK REVIEW

Anyone seen this problem with Safari XHR request?

Yesterday was the big day for testing my Ajax functionality in my application at work. All went well on all of the main browsers until Safari was brought into the mix. The browser just ended up going to the site error page saying I was sending an invalid Guid.

Well I checked my variables on the client and everything was fine. Traced the server code and that is when I saw that Safari was appending a null terminator ("\0") to the end of my Guid. There was my problem as the log showed. I ran some other tests with this post and whatever my last parameter had on it, a \0 was appended to the end. I have never seen this on any other safari browser before, wondering if anyone has any clue why this happens.

My solution for this bug is to append an additional request parameter to the post so it is the last one in the list and gets the terminator appended to it. I saw this to be easier then checking all of my request parameters and making sure they did not contain a \0.

Hopefully someone can shine some light into this!
Eric Pascarello
Coauthor of Ajax In Action
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages


No, but I'm new to Ajax development, and use Safari frequently, so I'm most appreciative to see you pointing out things like this. :)


Add a comment

Title
Body
HTML : b, i, blockquote, br, p, pre, a href="", ul, ol, li
Math Quiz 7 + 2 = (Helps stop blog spam)
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).

TrackBack to http://radio.javaranch.com/pascarello/addTrackBack.action?entry=1137514098207