summaryrefslogtreecommitdiff
path: root/itjs
diff options
context:
space:
mode:
authorChristian Weber2008-01-29 19:27:59 +0000
committerChristian Weber2008-01-29 19:27:59 +0000
commit2c73aef67a66d0f8a26dbe5ecbb9b1d30b3ce314 (patch)
tree834f3a7664d0602236b7e03a1c689462f6b6c523 /itjs
parent91c8ccf200d1f9bad40f1a4495f005505a25a9e0 (diff)
downloaditools-2c73aef67a66d0f8a26dbe5ecbb9b1d30b3ce314.tar.gz
itools-2c73aef67a66d0f8a26dbe5ecbb9b1d30b3ce314.tar.bz2
itools-2c73aef67a66d0f8a26dbe5ecbb9b1d30b3ce314.zip
use script instead of xmlhttprequest if firebug is installed (avoid firefox crash)
Diffstat (limited to 'itjs')
-rw-r--r--itjs/loader.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/itjs/loader.js b/itjs/loader.js
index 16a3deb..b5e0a44 100644
--- a/itjs/loader.js
+++ b/itjs/loader.js
@@ -51,8 +51,7 @@ load: function(baseurl, pos, num, query_volatile, retry)
this.num = num;
this.query_volatile = query_volatile;
- if (this.req)
- this.stop();
+ this.stop();
while ((num > 0) && this.entry[pos])
{
@@ -67,12 +66,12 @@ load: function(baseurl, pos, num, query_volatile, retry)
{
this.req = null;
var samehost = (baseurl.indexOf('http://') < 0 || baseurl.indexOf(window.location.hostname) > 0);
+ var use_script = (window.console && window.console.firebug) || !samehost; // use XMLHTTP request only if on same host and not using firebug
if (retry)
baseurl += "&retry=" + retry;
- // use XMLHTTP request if available
- if (samehost)
+ if (!use_script)
{
try
{
@@ -120,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 (samehost || (window.opera && !window.XMLHttpRequest)) // Opera 7 only works with iframes
+ if (!use_script || (window.opera && !window.XMLHttpRequest)) // Opera 7 only works with iframes
{
this.scrpt = document.createElement("iframe");
this.scrpt.style.width = this.scrpt.style.height = 1;