r-it Posted May 30, 2007 Share Posted May 30, 2007 i have this code: <script> function dologin(f) { var login = f.txLogin.value; var pass = f.txPass.value; var val = "top"; var obj = document.getElementById(val); var url = "check.php?logn=" + login + "&pass=" + pass; xmlhttp.open("GET", url, true); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); } </script> which basically handles my login form the thing is that it works fine in firefox, but internet explorer 6 is giving me a headache as it is just reloading the page instead of showing a message, i have not made a function for creating the mttprequests, they are rather declared at the top of my js script and are used (globally) throughout the script: //create a boolean variable to check for a valid IE instance var xmlhttp = false; //check if user's using IE try { //check if jvascript version is rgeater than 5. xmlhttp = new ActiveXObject("MSXML2.XMLHTTP"); } catch (e) { //if nt, then use older active x object try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { //else, user's not using IE xmlhttp = false; } } //if user's using a non-ie browser, create a javascript instance of the obj if(!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } the reloading happens after i get the responseText back, it completely reloads the page, and when i put an alert after the responsetext, then i can see the message in the page behind the alertbox, but as soon as i click ok, it reloads the page again, plz help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.