Error load XML data

Error load XML data

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:

  1. function get_xml() {
  2. $.get('rss/rss.xml', function(d) {
  3. if (typeof d == "string") {
  4. var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
  5.         xmldoc.async = false;
  6.         xmldoc.loadXML(d);
  7. } else {
  8. var xmldoc = d;
  9. }
  10. rssitems = $(xmldoc).find('item');
  11. // set total count indiciator
  12. $("#count_total").text($(rssitems).length);
  13. // preload all images associated with rss items
  14. if (document.images) {
  15. imageObject = new Image;
  16. $(rssitems).find('enclosure').each(function () {
  17. imageObject.src = $(this).attr('url');
  18. });
  19. }
  20. },($.browser.msie)?"text":"xml");
  21. }
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.