From b9a85c43ef088697b17bb939005099704b9400f5 Mon Sep 17 00:00:00 2001 From: Denis Demesmaeker Date: Mon, 19 May 2008 13:11:21 +0000 Subject: handle urls without querystring correctly --- itjs/loader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/itjs/loader.js b/itjs/loader.js index 25bb33c..99b918d 100644 --- a/itjs/loader.js +++ b/itjs/loader.js @@ -70,7 +70,7 @@ load: function(baseurl, pos, num, query_volatile, retry) 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; + baseurl += (baseurl.match(/\?/) ? "&" : "?") + "retry=" + retry; if (!use_script) { @@ -95,7 +95,7 @@ load: function(baseurl, pos, num, query_volatile, retry) try { - this.req.open(this.method, baseurl + "&pos=" + pos + "&num=" + num + (query_volatile ? query_volatile : "")); + this.req.open(this.method, baseurl + (baseurl.match(/\?/) ? "&" : "?") + "pos=" + pos + "&num=" + num + (query_volatile ? query_volatile : "")); var me = this; this.req.onreadystatechange = function() { me.readyStateChanged(); } var workingxmlhttp = this.req.onreadystatechange; @@ -118,7 +118,7 @@ load: function(baseurl, pos, num, query_volatile, retry) } else { - 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; + var req_url = baseurl + (baseurl.match(/\?/) ? "&" : "?") + "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 (!use_script || (window.opera && !window.XMLHttpRequest)) // Opera 7 only works with iframes { -- cgit v1.2.3