On Tue, Dec 8, 2009 at 5:53 AM, Sree <[email protected]> wrote:
> I have this piece of code where it sends an ajax request from a webpage.
> var baseURI = document.baseURI;
> var docURI = baseURI.split('#')[1];
> var url = "some request of my own";   // Not from a different origin
> var xmlhttp;
> xmlhttp=new XMLHttpRequest();
> xmlhttp.onreadystatechange=function() {
> if(xmlhttp.readyState==4) {
> alert('ready');
>  }
> };
> xmlhttp.open("GET",url,true);
> xmlhttp.send();
> This code is not working, even though i dint see any errors in a window when
> i open using Ctrl+Shift+J
> where as if I change the if condition to xmlhttp.readyState==1 the alert
> fires. with rest of any numbers the alert is not firing.
> Am I doing anything wrong...

Can you try the same with a file:// URL? Put this HTML and the file to
request next to each other in a folder and run the HTML file. I bet
you will see the same (no readyState == 4). I think that the
readyStates for file URLs are different. If so, this would be a bug in
WebKit.

- a

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to