I have this code:
.load($(this).attr('href'), function (responseText, textStatus) {
Now, I want to modify that to loading a predefined variable instead of the href attribute. I tried this here but get an error:
params="option=1"; // example
var URL=ajax_url+"/?"+params;
.load($(this)URL, function (responseText, textStatus) {
What's the correct way?
hrefattribute is an URL used for the ajax call, you want a valid URL with a valid querystring, and it should work, assuming you do.load(URL, function() {...-> learn about variables