Home > Coding, jQuery > Interesting little jQuery ajax POST bug with Chrome

Interesting little jQuery ajax POST bug with Chrome

After adding support for POST requests to my back end, of course I wanted to make the front end use it. so I switched the ajax requests to use POST instead of get. Worked fine in Firefox so I was happy. Tried it in Google Chrome this morning and I found I was not getting any data with the post request.

After some digging around the jQuery forums I found that adding data:null to the ajax setup helped things along. Something to do with jQuery using an uninitialized variable or something. Whatever, it fixed it!

So now the ajax setup in my index page’s ready function looks like this:

$.ajaxSetup({      
   cache: false,    
   data : null      
 });
Advertisements
Categories: Coding, jQuery Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: