scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true">
data-url="http://appzman.com/blog/?p=414">
news and informations automotive,business,crime,health,life,politics,science,technology,travelautomotive,business,crime,health,life,politics,science,technology,travel
I found one more reason to love IE (ironic)
For last few days (it was low priority project) I was trying to find out why my web app doesn’t work under IE 10.
It was surprising for me because I didn’t have problem with web app with other browsers like Safari, Firefox or Google Chrome. After some debugging I narrowed down problem to AJAX call.
I will save you reading all my code provided below, and tell you what was wrong.
So IE didn’t like console.log.
Yes, CONSOLE.LOG!!! WTF Microsoft????
My AJAX call wasn’t executed because console.log statement was written before the send() method…
The only reason why I found it is because web app was working fine whenever I had developers tool on.
Now. What do you think it’s the reason this behavior?
I agree that we should always write a clean code, but WTF. If you want to have logging statement in my code I should be able to have it!
var insertXmlhttp;
var updateXmlhttp;
var validateXmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
insertXmlhttp=new XMLHttpRequest();
updateXmlhttp=new XMLHttpRequest();
validateXmlhttp = new XMLHttpRequest();
}
else
{// code for IE6, IE5
insertXmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
updateXmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
validateXmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
insertXmlhttp.onreadystatechange=function()
{
if (insertXmlhttp.readyState==4 && insertXmlhttp.status==200)
{
current_attemptId = insertXmlhttp.responseText;
}
}
function startTheAttempt (activity, score)
{
console.log("And now in ajax.js Start The Attempt: ");
insertXmlhttp.open("POST","../Scripts/attempt.php",true);
insertXmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
insertXmlhttp.send("action=start&activity="+activity+"&score="+score+"&userid="+userId);
alert(" Start The ATTEMPT 2 + ");
}