Javascript load()在每次页面加载时只发送一次POST参数

Javascript load()在每次页面加载时只发送一次POST参数,javascript,php,jquery,Javascript,Php,Jquery,我有这个剧本: $('#openBtn').click(function(){ $(".modal-body").load("/show.php?fFuehIFj1L0vS6Hp", {oi: $("#oi").val(), txtid: $("#txtid").val()}, function(result){ $('#myModal').modal({show:true}); }); }); 这个html: <a href="#

我有这个剧本:

  $('#openBtn').click(function(){

       $(".modal-body").load("/show.php?fFuehIFj1L0vS6Hp", {oi: $("#oi").val(), txtid:    $("#txtid").val()}, function(result){
        $('#myModal').modal({show:true});
     });

});
这个html:

 <a href="#" class="btn" id="openBtn">Open modal</a>

 <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog">
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">×</button>
        <h3>Modal header</h3>
</div>
<div class="modal-body">
    <p>My modal content here…</p>
</div>
<div class="modal-footer">
    <button class="btn" data-dismiss="modal">Close</button>
</div>

×
模态头
我的模态内容在这里

接近

我希望每次单击都发送POST变量并检索远程页面,但现在它只在第一次单击时发送POST变量,之后我必须刷新我的页面

你是指javascript上的hashchange吗? 就这样

site.com/blah#content=1


出于好奇,你为什么在那个div上有一个tabindex?我以前从未见过。
load()
使用
GET
,因此它根本不发送
POST
参数?@adaneo,如果数据作为对象提供,则使用POST方法
function hash()
{
var hash = window.location.href;
hash = split("#", hash);
hash = hash[1]; // this is hash param
return hash;
}

$(window).on('hashchange', function() {
$("#page").load("index.php?"+hash());
});

$(window).ready(function() {
$("#page").load("index.php?"+hash());
});