【发布时间】:2013-12-11 08:07:20
【问题描述】:
我是一个 asp.net 编程人员,我试图在没有请求服务器的情况下加载页面。 如何在不使用 asp.net 和 jquery 在浏览器上重新加载页面的情况下加载页面和发送参数?
【问题讨论】:
标签: javascript jquery asp.net ajax
我是一个 asp.net 编程人员,我试图在没有请求服务器的情况下加载页面。 如何在不使用 asp.net 和 jquery 在浏览器上重新加载页面的情况下加载页面和发送参数?
【问题讨论】:
标签: javascript jquery asp.net ajax
你可能想要$.load
$("#target").load("/server/path/to/source.html");
【讨论】:
hash 部分位置而无需重新加载页面。例如window.location.hash = "page=2&param=aaa"
您需要使用 ajax 查询。请求仍然会异步发送到服务器。 所以你的页面不会刷新。
Here是jquery ajax函数。
$.ajax({
type: "GET",
url: "/AjaxController.aspx",
dataType: "html",
success : function(){
$("#div1").html(result);
}
});
【讨论】:
html
JSON.parse(result);