• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ajax no response

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,



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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My apologies.

I have checked in Mozilla and IE. Does not work in both.
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am wondering if you have an issue with variable scope. Your var xmlHttp is local.

Eric
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope. I tried making it global. Same results.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Eric
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi try putting the statechange function inside



If you do get the alert great. If not check your url by simply printing the vendorId parm.
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

For some reason,



this works perfectly.
But this does not


Thanks
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like there is no difference. Make sure you do not have a typo.

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic