我有这个:
$.post("http://www.roblox.com/My/Money.aspx/GetMyTransactions", {"startindex": 20, "transactiontype": "purchase"});
而且我不知道如何更新"页面或显示帖子中的信息。帮助
编辑:
我只想知道如何更改div的内容" TransactionsContainer"
答案 0 :(得分:1)
<script>
$(document).ready(function(){
$.post("http://www.roblox.com/My/Money.aspx/GetMyTransactions", {"startindex": 20, "transactiontype": "purchase"}, function(result){
$("span").html(result);
});
});
</script>
<span>Result will be displayed here</span>
详细了解jQuery .post
答案 1 :(得分:0)
$.post( "test.php", { name: "John", time: "2pm" })
.done(function( data ) {
alert( "Data Loaded: " + data );
});
答案 2 :(得分:0)
您可以为$.post
指定一个带有函数的第三个参数。该函数由服务器作为参数提供响应。
$.post(
"http://www.roblox.com/My/Money.aspx/GetMyTransactions",
{"startindex": 20, "transactiontype": "purchase"},
function(response) {
// response contains the response object from the server.
$('[some selector]').text(response);
}
);