I am using this javascript. It is called onChange of a drop down. I also tried running the response page individually and it is running fine. In IE it gives an error xmlHttp is undefined. The statechanged is always 0.
What should I do?
Thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35253
7
posted
0
Hello "sarvagna"-
You've been around the ranch long enough to know that we have a policy on screen names here at JavaRanch. It must consist of a first name and a last name. Since yours does not conform with it, please take a moment to change it, which you can do right here.
As to your question, if there's an error about xmlHttp being undefined, it's not surprising that statechanged doesn't change, now is it? Which path through the GetXmlHttpObject method is the code taking? Does it work in other browsers?
I have checked in Mozilla and IE. Does not work in both.
Sahana Hegde
Ranch Hand
Joined: Jan 27, 2008
Posts: 67
posted
0
I also checked if that path is opening up correctly by giving the same in window.open(url). Thats working correctly. I am using coldfusion to send the response.
[ August 08, 2008: Message edited by: Sahana Hegde ]
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35253
7
posted
0
As I said, it doesn't matter whether the response works, if the request can't even be sent.
Again: Which path through the GetXmlHttpObject method is the code taking?
Sahana Hegde
Ranch Hand
Joined: Jan 27, 2008
Posts: 67
posted
0
When I use firefox it creates it comes here xmlHttp=new XMLHttpRequest();, does not work. If I use IE still it takes the same path.
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
6
posted
0
I am wondering if you have an issue with variable scope. Your var xmlHttp is local.
Eric
Sahana Hegde
Ranch Hand
Joined: Jan 27, 2008
Posts: 67
posted
0
Nope. I tried making it global. Same results.
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
6
posted
0
I just ran the code fine with a few changes [removed the indexof lines and changed the url], make sure you do not have any javascript errors being reported.