[Logo]
Forums Register Login
ajax status code 0
I have closed the old post as i now know more, and feel that was a dead end

this is my html page. I am using the xmlHttpRequest method as it gives me most control to see what is actually happening, as my method was going into the success callback and not the error callback when using jquery.



I am testing inside eclipse and have breakpoints inside my servlet.
I am getting an alert saying "Error: status code is 0"
before I even get to my breakpoint. I get this alert twice and that is it.
I have looked up the status codes and they should all be 3 digits long. I saw one post that suggested this maybe a firewall but as this is all on my localhost, i thought it couldn't be that.
So any other ideas?
What's creating the response with a status cod of zero?
I thought i would add this:
My servlet is being called, the logging is output, and my breakpoint is stopped at. But after the onReadyStateChange function has been called with a status of 4 (ready)

I have been doing more research and these are more options:

- Same domain policy and that just having FindBarAjaxServlet may not match as the same domain.
My call has been changed to


- If it is ZERO than you are using the local file system and that means
success. You only get 200 when you are running on the http protocal.

I am using tomcat, does this apply in that case?
 
Bear Bibeault wrote:What's creating the response with a status cod of zero?


I think that is my question!
I am calling a servlet, which is indeed being called, but after i have recieved the response
Then the servlet isn't creating the response? That doesn't make any sense. What is?

Also, what's with the absolute URL? That's bound to cause issues, if not now, then down the road.
Ok this is a firefox issue (3.6.12)
i just tried it on explorer and it worked after giving me this popup "this page is accessing information that is not under its control. This poses a security Risk. Do you want to continue? Y/N".
Or without the prompt if i take the full path out.



i have solved the problem it was the


in the html, i don't know why that was causing it, if anyone could enlighten me i would be grateful
(1 like)
Status zero happens when

1) Page is being served from file protocol
2) Page exits/refreshes as an active XMLHttpRequest is still being processed. It throws an "INVALID_STATE_ERR " error and sets the status to zero.

Cancel the link/button click and you should be good to go.

Eric

 
Eric Pascarello wrote:Status zero happens when

1) Page is being served from file protocol
2) Page exits/refreshes as an active XMLHttpRequest is still being processed. It throws an "INVALID_STATE_ERR " error and sets the status to zero.

Cancel the link/button click and you should be good to go.

Eric


Thanks Eric
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 23, 2017 04:49:05.