I am developing a website that uses JQuery to load and then display an RSS feed, and although I have things working in most web browsers, it fails in IE 8. In IE 8 when the page is first requested I get a Javascript error "Object doesn't support this property...", BUT if I click on the page reload button the error goes away and everything works just fine.
Even more strange is the fact that I have used the same code before on another website and it worked without a hitch.
The section of code that appears to be failing in IE is the actual $.get request:
- function get_xml() {
- $.get('rss/rss.xml', function(d) {
- if (typeof d == "string") {
- var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
- xmldoc.async = false;
- xmldoc.loadXML(d);
- } else {
- var xmldoc = d;
- }
- rssitems = $(xmldoc).find('item');
- // set total count indiciator
- $("#count_total").text($(rssitems).length);
- // preload all images associated with rss items
- if (document.images) {
- imageObject = new Image;
- $(rssitems).find('enclosure').each(function () {
- imageObject.src = $(this).attr('url');
- });
- }
- },($.browser.msie)?"text":"xml");
- }
Can anyone offer any suggestions as to what is going on?
I did find a
post related to this and following the comment below I was able to avoid the error, but this solution is impractical. At the moment I have not tried modifying the JQuery library itself as indicated in this post as I am currently using the minified version.
In IE7, if "Enable native XMLHTTP support" is checked (under Tools > Internet Options > Advanced tab > inside the security section) then this error shows up. Unchecking/disabiling the option seems to resolve the error.