SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot trekmp's Avatar
    Join Date
    Dec 2005
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with newXMLHTTP()

    Got a problem with the following code:
    Code:
    xmlhttp.open('POST',sQueryString,fHandler!=null);
    if(fHandler!=null){
    	        xmlhttp.onreadystatechange=function() {
    	alert(xmlhttp.readyState);
                    if (xmlhttp.readyState==4) {
                        //document.forms[0].elements['total'].value=xmlhttp.responseText
                        fHandler(xmlhttp.responseText);
                    }
                }
                xmlhttp.send(false)
                return false
    	    }else{
    	        xmlhttp.send(false);
    	    	return xmlhttp.responseText;
    	    }
    It all works fine in IE, FF, K-Meleon, but for some reason doesn't work in Opera V8, cannot use the new version at the minute. It doesn't seem to like this part of it in Opera

    xmlhttp.onreadystatechange=function() {
    blah blah
    }

    And i've no idea why, does anyone know of a way round this, and JS is not my strong point so you'll have to be clear.
    Why do we exist? What is our purpose?
    >H2O Developments
    >USS Endeavour
    >Hosted@Servage

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If this works in later Opera versions, then it is most probably a bug that got fixed.

    What happens if you try the following?
    Code:
    xmlhttp.onreadystatechange=function()
    {
        alert("Am i being alerted?");
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •