Do XMLHttpRequests work in internet explorer 11? - javascript

Refer to title question. I am very new to javascript and used it while making an html page for work on my laptop that works perfectly fine with Internet Explorer 8, but it does not work on anyone's computer that has installed IE11. As we are all supposed to upgrade to IE11 (nobody told me until this issue came up), I need to figure out why this works in IE8 and not IE11. I am guessing that the XMLHttpRequests are the issue. Basically I am using the xmlhttprequests to check if some files exist before posting them to the html page.
I'm in the process of requesting and getting approved to install IE11, but was hoping someone could clarify if I am correct that XMLHttpRequests do not work in IE11 and could possibly suggest any alternatives?
Edit:
Well magic stuff occurred and now its working.

Short answer: Yes.
Long Answer: Internet Explorer has supported XHR (XMLHTTPResponse) since IE 7. Since then it has improved considerably. There are many things that can stop code from working. Have you tried running your code in IE 11 and then checking the debug console to see what it says?
Unfortunately, since you did not post any code for us to examine; we can't really do much for you except answer your very specific and easily searchable question.
Recommendation: Use jQuery to do AJAX requests instead and examine the debug console for errors.

Related

How to deal with broken browsers?

I have a general question. I'm working on my first program in JavaScript and while I'm working on them I experienced some weird "broken browser"-problems.
During the weeks of work on my program I tested the project often on different browsers and computer systems. While doing it I observed weird behavior on Firefox and Chrome in specific versions. In both cases the program worked fine in both browsers then suddenly I experienced problems in Firefox on Windows on one machine. After some research I tried to update the browser and the problem was gone. The same experience I had on Chrome on Linux. It worked fine, then suddenly I had problems with Chrome 48. I tested the program on Mac and Windows, everything was fine. Then I recognized that the browsers on this machines has the version 54. So I updated on my Linux machine to the newest version and the problem was gone.
My Question: is it normal that such things happen with specific versions of browsers and if so, how to deal with it if you're working on bigger projects?
Edit: From the answers below I see that I was not clear with my question. The Question is not really about cross-browser compatibility than more about why a programm works in chrome v47, but not in v48, and then it works again in v54. Same for Firefox and other browsers.
You have to read about cross-browser compatibility.
Each browser may have different implemenations of specific functions or even do not have.
For older browsers like IE8 and less even simple window.innerWidth
doesn't work.
jQuery may help you. Its library which effectively provides cross browser compatibility for a lot of cases.
Another way to test if browser support some function is using Modernizr
You can also check support manually by websites like caniuse.com - works mainly for css styles but also js

Is there a tool to quickly run a short javascript in IE8, without having to run Internet Explorer?

For example, I found that calling something like this
document.getElementByID('myElement').value.trim();
crash in IE8 because strings don't have trim() in IE8. Is there any way (e.g. using some website in the internet) to run such short, one-off code to verify issues like this without having to find a computer with Internet Explorer?
I use Browserling all the time to make sure html renders properly. I know it does run javascript, but that's in the cloud. The paid version has a feature called "bug hunter" but I don't know exactly what it does. They have a 30 day money-back guarantee so it might be worth trying it for a month. Or you could email them and ask.
Use the Developer tools in the newer versions of IE.
Open IE (desktop mode) and press F12.
In the toolbar, you can select the Browser Mode and the Document Mode.

Javascript Error in IE 8- Site does not load

My site is http://www.ancientwords.us. I've tried every Javascript troubleshooting tool in the book, but I can't see to figure out why the site isn't loading in IE 8 (or IE7 for that matter).
When using IE10 in IE8 mode, I get a notification that there is a non-responding script, hence why I think it is a Javascript related error. Even still, I haven't been able to find a tool that has been able to tell me what's wrong.
I've tested the site in Safari, FireFox, and Chrome and everything works fine. The site also works fine in IE9 and IE10.
Does anyone have any advice?
Turns out Cloudflare was causing the problem. The Rocket Loader feature is not compatible with older versions of IE.
Did you report the Rocket Loader bug to us?

Should I be worried that my site crashes IE9 and how to fix?

I've downloaded the latest version of IE9 beta and my site wrecks it. No problems on any other browser, but on IE9 it freezes on every page. The thing is, many other sites also make it gag.
Should I worry?
IE's fault or do my site and I need to do some serious soul searching?
How does one debug this stuff and are there a list of common culprits? Is it most likely a Javascript issue? jQuery?
If your site is dying on IE9 (assuming it's not the result of known IE9 bugs), you definitely need to address it. You can download tools like the IE Developer Toolbar to help you move about within your page once it's loaded, and there are other resources online like jslint that will help you examine some of your javascript and work on its quality.
If you find any specific issues that you're unsure of how to address, please don't hesitate to return here and post more questions - there are (literally) thousands upon thousands of brilliant minds waiting to assist you.
Update - You mentioned in the comments below that IE9 dies before you can even determine what is causing it to die. This is (unfortunately) the case with much software. Often times you can try to repeat the same actions in Chrome, Firefox, Opera or some other browser and see how it responds. Many times you'll find that another browser may provide an error without crashing entirely. This could give you some insight into what may be causing IE to crash.
Jonathan submitted a great answer about using jslint to verify the integrity of the JavaScript, and using other debug tools on other browsers to detect for a non-crash error. I did both and thoroughly went through my site, only to find that IE9 was still crashing!
So I looked into it and here's what I found: the main cause of IE9 beta crashes are add-ons that are incompatible with the new release. Adobe PDF viewers, printer add-ons, toolbars, etc. Most everyone has at least one add-on in their browsers. So I disabled all my add-ons and now my site works.
I'm not sure why my site seemed to crash more than others with IE9, but if people are having problems with there site, I'd suggest (1) disabling all add-ons just in case, and then (2) using Jonathan's answer (which I'll leave checked as the official answer since it has to do more with programming).

ASP.NET AJAX 3.5 and IE6?

I recently upgraded an ASP.NET app to .NET 3.5 and switched to the newer version of the ASP.NET AJAX library.
In FireFox and IE7, everything works great, in IE6, anything that would perform a callback (Partial Refresh, or calling a PageMethod/WebMethod) throws an error:
Object Doesn't support this property or method
Line: 5175
Char: 9
Is there a known compatibility issue with .NET 3.5 and IE6?
EDIT:
I attached a debugger to IE6 and was able to find the exact line it is breaking on:
this._xmlHttpRequest.open(verb, this._webRequest.getResolvedUrl(), true /*async*/);
It appears that IE6 is denying the permission to do "open". This is not a cross-site request, so I am puzzled. This site is currently running on a fake hostname mapped to a local server, and not on an actual domain, but I don't think that should make a difference.
EDIT: I added a bounty, this bug is still driving me nuts...HALP!
EDIT:
Solution found!
This forum post made me curious enough to search for MXSML, and sure enough, there it was, a typo in the framework library.
MsXML was typed as MXsml.
Of course, when dealing with assembly scripts, you can't do much to fix them, but I installed SP1 hoping that they were corrected there. They were...So, if you have this issue, install .NET 3.5 SP1 and it will go away.
Woo!
How are you testing in IE6? I have come across several javascript errors when you using anything but a clean install of only IE6 in conjunction with the asp.net ajax libraries. (ie. the asp.net ajax libraries don't support multiple installs of IE, or even IETester)
It is something in the IE security model that makes things go haywire when multiple version's of IE are used. You'll find that cookies won't work right either in anything but the "installed" version of IE on the system you are running.
You may also look here for some more information on multiple IE installs. If found the comments to be particularly helpful!
UPDATE
I was able to dig, this up in the asp.net fourms. That's the only other thing I could find. May not be too be too helpful, but it at least sounds about like what you are hitting.
According to MSDN IE6 is supported. Make sure that the Internet Zone in the Security Zones settings are set to Medium.
Another one from the asp.net forums
http://forums.asp.net/p/1376680/2896886.aspx
Could be caused by different versions of the XmlHttpRequest object

Categories