Code not working under IE ...

Discussion in 'JavaScript' started by redhits, Jun 16, 2008.

  1. #1
    This code works under Firefox , but it's not working under IE + it's giving a coding error , the error it's reported into the IE status bar, at the bottom of IE...
    
    
    <div class="ranks" name="ranks" id="ranks">Loading...</div>
    
    
    
    <script type="text/JavaScript">
    function trimite(url, parametri, divname){
    
          if (window.XMLHttpRequest) { Ajax = new XMLHttpRequest();  }
    else if (window.ActiveXObject) {  if(!Ajax){Ajax = new ActiveXObject("Msxml2.XMLHTTP");}
                                      if(!Ajax){Ajax = new ActiveXObject("Microsoft.XMLHTTP");}
                                                   }   
    
    function schimbari(){
    if(Ajax.readyState == 4){document.getElementById(divname).innerHTML=Ajax.responseText;  }
    
    
    }  
    
    
    Ajax.overrideMimeType('text/html');
    Ajax.open('POST',url,true);
    Ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Ajax.setRequestHeader("Content-length", parametri);
    Ajax.setRequestHeader("Connection", "close");
    Ajax.send(parametri);
    Ajax.onreadystatechange = schimbari;
          
    
    
    
    
    
    
    
    
        
    
    } 
    
    </script> 
    
    
    
    
    
    
    <script type="text/JavaScript">
    
    trimite('page.html','url=none','ranks');
    
    </script>
    
    
    HTML:

     
    redhits, Jun 16, 2008 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    What is the text of the error ?

    I've seen you're using 'url=none' for second parameter on function trimite, and that parameter is used for "Content-length" value. IMO that value should be a number.
     
    ajsa52, Jun 16, 2008 IP
  3. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #3
    True but that is not the problem
     
    redhits, Jun 16, 2008 IP