发送带有jquery.load数据() [英] send data with jquery.load()

查看:105
本文介绍了发送带有jquery.load数据()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么发送一些数据到服务器的jQuery的.load()函数。我想这样的语法:

how do I send some data to the server in the .load() function of jquery. I tried this syntax:

$('container').load('path', {key: value});

但出于某种原因,这是行不通的。

but for some reason it doesn't work

推荐答案

.load 使用POST或GET根据传递的参数。

.load uses POST or GET depending on the parameter passed.

如果它是一个对象,它使用POST:

If it's an object, it uses POST:

$('container').load('path', {key: value});

否则,它将使用GET:

Otherwise, it uses GET:

$('container').load('path', 'key=value');

如果没有你的问题的任何其他信息,这是我能想出的帮助。

Without any other info in your question, this is all I could come up with to help.

这篇关于发送带有jquery.load数据()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆