Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

XMLHttpRequest not work on firefox and chrom, but work fine on ie?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a XMLHttpRequest problem, it work on IE, but it won;t work on firefox and chrome. I have no idea how to let firefox and chrome work.
I tried many method, still it won't work.
basely my web is let user select birthday,  when you choose year, it will automatic have month on scroll down option, but it will not have the month value on chrome and firefox.
It work fine on IE. Do anyone have any idea.

 
Rancher
Posts: 4622
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could be wrong here, but I don't think Chrome and Firefox allow ActiveX objects by default.
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave is correct. ActiveX is a Microsoft only technology. I suggest using jQuery for managing input elements. It will work across all browsers.
 
Marshal
Posts: 67425
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, this is just one of the many reasons to be using jQuery.
 
chenchih lee
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do anyone have any idea what should i changed in order to let all browser can used.
I don't really know how to used jquery.

 
Bartender
Posts: 322
24
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

chenchih lee wrote:Do anyone have any idea what should i changed in order to let all browser can used.
I don't really know how to used jquery.


Sorry, but what you need to change is the technology being used. You need to choose a technology that is supported by default by all browsers. That is not ActiveX. That is JQuery/JavaScript.

Maybe you wonder why non-IE browsers don't support ActiveX?

Firefox does not support ActiveX technology for multiple reasons.
  • ActiveX is only available on Windows operating systems, and as a result webpages that require it will not work on Linux or Mac.
  • ActiveX integration with the Windows operating system has made it a target for malicious software.

  • That's direct from Mozilla, makers of Firefox: https://support.mozilla.org/en-US/kb/ActiveX
     
    Bear Bibeault
    Marshal
    Posts: 67425
    173
    Mac Mac OS X IntelliJ IDE jQuery Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Now would be a great time to learn! jQuery solves many (many!) cross-browser problems.

    Although it's really (really!) odd to be doing a GET to a JSP (why are you doing this?), one way to use jQuery to get a resource is with the $.get() method:

    Yes, it's that easy.
     
    Bartender
    Posts: 1845
    10
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Maybe I'm missing something here.

    Chrome and Firefox still support the XMLHttpRequest object don't they?
    Why all this talk on ActiveX when there is a clear "else" statement in the code?
    Or has the code originally posted been edited/changed?  (I can't see any evidence of that)

    In general the code looks fine to me.
    It looks to have been a little mucked up - with the doSearchMonth() method nested inside the createXmlHttpRequest() but it is a fairly obvious typo.

    My main beef with it is that it appears to be using global variables.  I don't see a declaration of xmlHttp anywhere.

    My suggestions for debugging:  Use the F12 debugger!
    Put some console.log statements in so you can see where the flow is going.
    Set a break point and then step through - see if it is actually creating the xmlHttp object or not.
    Switch on the network monitoring so you can see if an HTTP request is being made or not.
    At the least you should be able to see an error message in the console.

     
    Bear Bibeault
    Marshal
    Posts: 67425
    173
    Mac Mac OS X IntelliJ IDE jQuery Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yeah, I saw that as well, but my point is that using "raw" JavaScript for Ajax is not only painful, but error-prone as well.
     
    chenchih lee
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    this i s my doSearchMonth()  code.
    thanks for replying. I wish i can solve this issue without rewriting this code.
    Basely this is my many yeas ago project. i just wish to implement this is my new web.



     
    Marshal
    Posts: 25682
    69
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    chenchih lee wrote:I wish i can solve this issue without rewriting this code.
    Basely this is my many yeas ago project. i just wish to implement this is my new web.



    And as various people have repeatedly said, there's no reason to use code like that any more and every reason to throw it away and use modern Javascript code.

    However if you're sentimentally attached to that code and don't mind expending a lot of time trying to get it to run, by all means go ahead and do that. There are people who have 50-year-old cars and spend much of their time tinkering with them and trying to keep them running, so it's not out of the question for you to be like them. But those people form a very small community -- most people prefer to just have a car which gets from A to B without costing too much -- so they are quite often figuring out things on their own.
     
    Whose rules are you playing by? This tiny ad doesn't respect those rules:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
      Bookmark Topic Watch Topic
    • New Topic