Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Javascript: Why isn't my script working in Internet Explorer?
I have an ajax scrip that has a prompt in it. I don't know why the prompt isn't working though, the prompt by itself works perfectly fine however when I put it into my ajax script, it doesn't even show up. The odd thing is... my script works fine in Firefox, just not in Internet Explorer 7.0! Please help, thanks!
The ajax script alone works as well, it is just that when they are combined, the prompt stops working.
3 Answers
- shadowLv 51 decade agoFavorite Answer
You must use the following code in order to be sure that the request is going to be sent:
function createXMLHttpRequest()
{
var xmlHttp=null;
if (window.ActiveXObject)
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
else
if (window.XMLHttpRequest)
xmlHttp = new XMLHttpRequest();
return xmlHttp;
}
That function return the correct activeX control or the XML class, according to the browser.
Then, just do this:
conection = createXMLHttpRequest();
And you get, code for both browsers.
- 1 decade ago
Maybe you haven't checked the proper implementation of Ajax for IE. Internet Explorer uses an ActiveXObject, while other browsers like Firefox uses the built-in JavaScript object called XMLHttpRequest. A tutorial from w3schools (link below) shows how to cover both.
You could also make use of already built interfaces for Ajax and other Javascript constructs like scriptaculous.js or Yahoo! UI, which are really more convenient to use, but the downside is, they implement so much which you may not use.
But, a copy of these libraries are probably on most, if not all, computers because many sites use them so no need to worry about added download for clients.
You just have to bear with the learning phase. Goodluck!
------------------------------------------------------------------------------
Have you tried to see if the prompt script alone works on both browsers?
Source(s): http://www.w3schools.com/ajax/ajax_browsers.asp http://script.aculo.us/ http://developer.yahoo.com/yui/ - ?Lv 45 years ago
do you have adblocker or yet another extension like that put in? would desire to a minimum of something in particular blocking off flash (the javascript message is almost a default message at the same time as flash cant play)