jQuery $ .post发布数据

编程入门 行业动态 更新时间:2024-10-27 12:36:27
本文介绍了jQuery $ .post发布数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是我的发布方法:(代码根据教程而定)

this is my post method :(Code is as per tutorial )

$.post('test.htm',{name:test_name"}, function (data) { $('#feedback').html(data); });

我想在test.html上附加'name'参数,然后在index.html页面上检索完整的数据

I want to append'name' parameter on test.html .and then retrieve complete data on index.html page

Test.html

Test.html

<body> <div> welcome + //How to append name here ?? </div> </body>

我可以通过"$_POST"命令在php上完成此操作....在HTML页面上还有什么替代方法..

I can do it on php by "$_POST" command .... whats the alternative of it on HTML page ..

最终数据将显示在index.htm中

Final data will be display in index.htm

<body> <input id="button" type="submit" value="Go" /> <div id="feedback"> </div> </body>

类似的帖子:

如何将这些数据发布到http服务器? jQuery帖子未返回数据 jQuery帖子数据 jQuery-使用帖子数据重定向

How do I POST this data to an http server? jQuery post not returning data Jquery Post Data jQuery - Redirect with post data

推荐答案

$.post接受要传递给服务器的对象,就像这样

$.post accepts an object to be passed to the server, like so

$.post('test.htm', {name: "test_name"}, function (data) { $('#feedback').html(data); });

当然,在.htm页面中没有任何内容可以捕获请求,您将需要某种服务器端语言.

of course, in a .htm page there is nothing to catch the request, you'll need a serverside language of some sort.

更多推荐

jQuery $ .post发布数据

本文发布于:2023-10-12 00:22:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483259.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据   jQuery   post

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!