开发者

Post to entire document like a form using jquery?

开发者 https://www.devze.com 2022-12-19 05:01 出处:网络
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)

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号