From d0b77364f69784ca75085710d6f019007ca1b992 Mon Sep 17 00:00:00 2001 From: Thomas BrĂ¼derli Date: Wed, 12 Sep 2007 09:16:46 +0000 Subject: Use iframes if possible (to prevent IE6 crashes) --- itjs/loader.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/itjs/loader.js b/itjs/loader.js index 3735bca..2089679 100644 --- a/itjs/loader.js +++ b/itjs/loader.js @@ -66,12 +66,13 @@ load: function(baseurl, pos, num, query_volatile, retry) if (num > 0) { this.loader = null; + var samehost = (baseurl.indexOf('http://') < 0 || baseurl.indexOf(window.location.hostname) > 0); if (retry) baseurl += "&retry=" + retry; // use XMLHTTP request if available - if (baseurl.indexOf('http://') < 0 || baseurl.indexOf(window.location.hostname) > 0) + if (samehost) { try { @@ -118,7 +119,7 @@ load: function(baseurl, pos, num, query_volatile, retry) { var req_url = baseurl + "&pos=" + pos + "&num=" + num + (query_volatile ? query_volatile : "") + (this.post_data ? '&' + this.post_data : "") + "&itjs_call=it_loader.__inst" + this.instance + "&itjs_callid=" + ++this.callid; - if (window.opera && !window.XMLHttpRequest) // Opera 7 only works with iframes + if (samehost || (window.opera && !window.XMLHttpRequest)) // Opera 7 only works with iframes { this.scrpt = document.createElement("iframe"); this.scrpt.style.width = this.scrpt.style.height = 1; -- cgit v1.2.3