这是我的发布方法:(代码根据教程而定)
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发布数据
发布评论