Bug Tracker

Ticket #1579 (closed bug: duplicate)

Opened 1 year ago

Last modified 3 months ago

1.2 Ajax method strips query string from URI

Reported by: buzz27 Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.1 Component: core
Version: 1.2 Keywords:
Cc: Needs: Review

Description (last modified by john) (diff)

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

Change History

Changed 1 year ago by stosh1985

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 1 year ago by john

  • status changed from new to closed
  • resolution set to duplicate
  • description changed from 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. to 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.

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

Note: See TracTickets for help on using tickets.