Hi,
I'm using the jQuery load function to make an AJAX call. I know that paired key : value variables placed after the url are POSTED but I need to be able to pass these values in dynamically depending on the function that's calling load.
so for example I need:
Code:
var post_content;
....
[post_content is set dynamically]
$('page_content').load(url, post_content, function() {..do stuff...});
In this case
post_content is a global var whose value changes depending on the data I need to pass to the load function.
I've tried doing stuff like this:
Code:
post_content = "{'id' : '1', 'answer' : 'yes'}";
but instead of posting that data...it just adds it to the query string and does a GET.
Is there any way to dynamically set this
post_content variable and have is passed so that it will POST as if I've done this:
Code:
$('page_content').load(url, {'id':'1', 'answer':'yes'}, function() {..do stuff...});
Because in that case the data gets POSTED.
Thank you in advance.