使用jQuery的ASP.NET - POST vs GET
Ok, I have a very silly question to ask (which Im rather embaressed about I must admit!). Im using the nyroModal plugin for jQuery within an ASP.NET 3.5 WebForms app. Basically, let's say I have a hyperlink pointing to http://www.mysite.com/GetData.html?id=100
好吧,我有一个非常愚蠢的问题要问(我很遗憾,我必须承认!)。我在ASP.NET 3.5 WebForms应用程序中使用jy的nyroModal插件。基本上,假设我有一个指向http://www.mysite.com/GetData.html?id=100的超链接
When the link is clicked, I want GetData.html to extract data from a database and populate some innerHTML elements with the return data. the querystring value will be extrcated using jqURL plugin for jQuery, and I will use jQuery's built-in Ajax function to make a call to a webservice passing in the id as a parameter.
单击链接时,我希望GetData.html从数据库中提取数据并使用返回数据填充一些innerHTML元素。查询字符串值将使用jQuery的jqURL插件进行分解,我将使用jQuery的内置Ajax函数来调用传入id作为参数的web服务。
My question is this: How do I use jQuery.Ajax() if this is not a POST method, but rather a GET method, from how I understand it? According to documentation, in order for $.ajax() to work, the type must be "POST".
我的问题是:我如何使用jQuery.Ajax()如果这不是一个POST方法,而是一个GET方法,从我的理解方式来看?根据文档,为了使$ .ajax()工作,类型必须是“POST”。
Could someone please shed some light on this for me?
有人可以帮我解释一下吗?
Thank you
3 个解决方案
#1
You have many options:
你有很多选择:
1- use the load method:
1-使用加载方法:
$('#container').load(("/page");
2-use the get command:
2 - 使用get命令:
$.get('/page')
3-use the ajax command:
3使用ajax命令:
$.ajax({
type:'GET',
url:'/page',
success:function() {
}
})
更多相关文章
- 分享27款非常棒的 jQuery 表单插件
- jQuery 事件绑定方法(bind hover toggle live.... )、删除事件方法
- 推荐一款好用的jquery弹出层插件——wbox
- JQuery滚动条插件jScrollPane的详细使用(除去点击边框)
- jQuery Ajax 方法调用 Asp.Net WebService
- jqueryui autocomplete 插件 点击 显示选项设置方法
- jQuery中的bind绑定事件与文本框改变事件的临时解决方法
- js和jquery使按钮失效为不可用状态的方法
- JQuery标签输入插件ASP.NET不工作