I found strange bug (maybe). When I send parameters to $.ajax in a form of hash, and tried to check that params in $.ajaxSend, I found that settings.data is null, settings.url was normal with parameters included. Then I look inside jQuery code, and found that data erased.
// If data is available, append data to url for get requests if ( s.data && type == 'GET' ) { s.url += (s.url.match(/\?/) ? '&' : '?') + s.data; // IE likes to send both get and post data, prevent this s.data = null; }
Now I am in need of parsing url ((. What to do?
In JQuery, using ajaxSend to preview the url built by $.post call
Here in comments I see that data should be there.
By default anything passed as data that is not a String is processed and transformed into a query string. So, if you use POST to skip the bug:
in
$.ajaxSendthe value ofsettings.datawill be'param1=val1¶m2=val2'and you will need to parse the parameters, like with GET.If you want to avoid parsing the url or data just add a copy of the data when building the settings object. The extra parameter should not cause any problem.
Then, in
$.ajaxSendyou can check the values insettings.dataCopy.