Post to entire document like a form using jquery?
i wan't to pass a variable without using get to php, so, i'm using post with jquery, but i can't write the result into the document (refresh all the page)
here is the code:
$.post("/"+$(this).attr("href"),{returnto:$(this).attr("rel")},function(a){$(document).html(a);});return 开发者_Python百科false;});
The document is not the place to write your result as the document is the meta envelope around the html page you see. Rather use the body:
$("BODY").html("MY ANSWER IS: "+a);
精彩评论