开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜