Skip to main content

Bug Tracker

Side navigation

#1579 closed bug (duplicate)

Opened September 11, 2007 12:22PM UTC

Closed September 15, 2007 01:21AM UTC

Last modified October 14, 2008 10:50AM UTC

1.2 Ajax method strips query string from URI

Reported by: buzz27 Owned by:
Priority: major Milestone: 1.2.1
Component: core Version: 1.2
Keywords: Cc:
Blocked by: Blocking:
Description

The ajax method will not POST to URI's with a query string. So if I need to POST to app.com/script.php?ajax I'm losing the ajax. I think using a query string to tell your scripts you are making an ajax request is a common pattern. If there is no workaround, farily substantial changes to applications could be needed.

Awesome work on 1.2 BTW.

Attachments (0)
Change History (2)

Changed September 14, 2007 11:22PM UTC by stosh1985 comment:1

The code which causes this problem is (lines 2180-2184):

var q = s.url.indexOf("?");
if ( q > -1 ) {
	s.data = (s.data ? s.data + "&" : "") + s.url.slice(q + 1);
	s.url = s.url.slice(0, q);
}

While I don't think this "feature" is entirely a bad idea, it has caused a number of problems for me, and I have subsequently commented out this section in my local copies. I would suggest maybe implementing an additional option, something like "parseURI" which could be a boolean value by default set to true?

I don't see anything to implement this functionality in 1.1.4 and I don't see it marked in a change log so I'm somewhat surprised.

Can this be fixed for those of us who need to be able to utilize post's to url's with query strings?

BTW, I concur with buzz27, excellent work on 1.2! Thanks for all your efforts.

Thanks,

  • Stan

Changed September 15, 2007 01:21AM UTC by john comment:2

description: \ The ajax method will not POST to URI's with a query string. So if I need to POST to app.com/script.php?ajax I'm losing the ajax. I think using a query string to tell your scripts you are making an ajax request is a common pattern. If there is no workaround, farily substantial changes to applications could be needed. \ \ Awesome work on 1.2 BTW.The ajax method will not POST to URI's with a query string. So if I need to POST to app.com/script.php?ajax I'm losing the ajax. I think using a query string to tell your scripts you are making an ajax request is a common pattern. If there is no workaround, farily substantial changes to applications could be needed. \ \ Awesome work on 1.2 BTW.
resolution: → duplicate
status: newclosed

Fixed in SVN rev [3295]. Duplicate of bug #1580.