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() {
}
})

更多相关文章

  1. 分享27款非常棒的 jQuery 表单插件
  2. jQuery 事件绑定方法(bind hover toggle live.... )、删除事件方法
  3. 推荐一款好用的jquery弹出层插件——wbox
  4. JQuery滚动条插件jScrollPane的详细使用(除去点击边框)
  5. jQuery Ajax 方法调用 Asp.Net WebService
  6. jqueryui autocomplete 插件 点击 显示选项设置方法
  7. jQuery中的bind绑定事件与文本框改变事件的临时解决方法
  8. js和jquery使按钮失效为不可用状态的方法
  9. JQuery标签输入插件ASP.NET不工作

随机推荐

  1. View常见XML属性及相关方法
  2. Android伸手党系列之二:Android开发基础知
  3. Android 底层学习札记
  4. Android 带图标的textview
  5. Android 多屏适配
  6. Android(安卓)-> 如何避免Handler引起内
  7. Android 融云SDK 集成
  8. 【边做项目边学Android】手机安全卫士05_
  9. Android(安卓)Launcher 之 图标加框 优化
  10. android 开机流程