jQuery.post()里面的一个jQuery.post()

想象一下,通过使用jQuery .post()(或.get())的菜单加载内容的网站.

想象一下,在这个动态加载的内容里面应该是另一个jQuery的帖子来显示一些更多的内容

(全部不导航到地址栏中的新文件)

这是我的意思(但只有基础框架…):

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<input type="text" name="n" id="n" placeholder="Search..." />
<button id="click1">Go</button>
<!-- the result of the search will be rendered inside this div -->
<br />
<div id="result" name="result"></div>

<script>
window.onload = (function(){
    /* attach a submit handler to the button */

    $("#click1").click(function(event) {
        $.ajax({
            url: 'test.PHP',type: 'POST',data: 'n: term',success: function(msg) {
                $( "#result" ).empty().append( msg );
              }
         });
    });
});
</script>

</body>
</html>

所以,停止笑,我知道这个页面只能加载在div中,而且这不是因为相同的ID而工作的…这是not Inception here

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...