Closed Thread Icon

Topic awaiting preservation: Javascript and Firefox Pages that link to <a href="https://ozoneasylum.com/backlink?for=25969" title="Pages that link to Topic awaiting preservation: Javascript and Firefox" rel="nofollow" >Topic awaiting preservation: Javascript and Firefox\

 
Author Thread
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 06-06-2005 05:19

The following page has Javascript and uses the xmlhttp request object to perform a client-side roundrtrip to the server to fetch additional information for a club within a state, and the club information. It does not work at all in Firefox. Any clues why not?

http://meetscoresonline.com/yourevent/registerevent.asp

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 06-06-2005 06:29

Just a guess (I don't know a lot about JavaScript ), but I'm seeing 'browser sniffing', which imo should be avoided, 'nn4', which should also be avoided, but more importantly I doubt is equivalent to any modern Netscape or Mozilla (Firefox), and ActiveX...let's not get started on that.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-06-2005 17:49

For XMPHTTPRequest it's not an instant thing (ergo the asynchrounous).

You need to assign an eventhandler to process the returned XML

code:
if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.open("GET", url, false);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.open("GET", url, false);
            req.send();
        }
    }



I'd do somthing like this

code:
if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");

    }
        if (req) {
            req.open("GET", url, false);
            req.onreadystatechage = doSomething; // This is the key line
            req.send();
        }



Then you create a function called "doSomething" to actually process the incoming data. Realize this isn't actually a request/response next action process.

I think you got your code from this site

Follow the steps in there for setting up the doSomething function



.:[ Never resist a perfect moment ]:.

« BackwardsOnwards »

Show Forum Drop Down Menu