views:

2791

answers:

3

I am begging to use jquery. I have the following call that works in IE7 but not FF 3.0.4. But if I change the null to {} it works fine. Is null not valid for this case and I just got lucky that it worked in IE or is this an error with jquery.

$.post("complexitybar.ashx?a=init&vc=" + validationCode, null, loadInitialValues, "json");
+1  A: 

Since the parameter you are attempting to pass null to is supposed to represent a key-value pair of data you want to pass to the url you are posting to, it probably makes alot more sense to use an empty object ({}) that null.

null isn't treated the same way as you might expect it would be if you are thinking of a language such as Java.

matt b
+6  A: 

Try $.get() for query-string requests:

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

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

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

With POST requests, the key-value pairs are sent as content data rather than as part of a URI.

Jonathan Lonowski
A: 

try $.ajajx with th e method "POST" , will be better