Jquery $ .post not working in Firefox

I ask you to use jquery. I have the following call that works in IE7 but not FF 3.0.4. But if I change null to {} , it works fine. Is null invalid for this case and I just got lucky it worked in IE or is it a bug with jquery.

 $.post("complexitybar.ashx?a=init&vc=" + validationCode, null, loadInitialValues, "json"); 
+4
source share
3 answers

Try $.get() for query string queries:

 $.get('complexitybar.ashx?a=init&vc=...') 

POST requests expect URL and key-value pairs to be split:

 $.post('complexitybar.ashx', 'a=init&vc=...') 

With POST requests, key-value pairs are sent as content data, and not as part of a URI.

+6
source

Since the parameter you are trying to pass null to should represent a key-value data pair that you want to pass to the URL to which you are sending messages, it probably makes sense to use an empty object ( {} ) that is null .

null not processed as you would expect if you thought of a language like Java.

+1
source

try $ .ajajx with the "POST" method, it will be better

0
source

All Articles