send data with jquery.load() [closed]

落爺英雄遲暮 提交于 2019-12-10 19:36:57

问题


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


回答1:


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

If it's an object, it uses POST:

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

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.



来源:https://stackoverflow.com/questions/9218677/send-data-with-jquery-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!