load content with Jquery together with sending variable in to it -
i have variable - x
in jquery, loading php part in div
block , need sent variable it.
so -
$(document).on('click','#link',function () { var x=5; $("#block").load("file.php"); });
in result still in same page.i need have variable x
in it.
i think use method or xmlhttprequest don't want page, need load php part in block.
one solution send data second argument:
$(document).on('click', '#link', function() { $("#block").load("file.php", { x: 5 }, function(res) { //your callback }); });
references
Comments
Post a Comment