jquery模拟a跳转(二次开发带搜索分页,不修改任何代码,携带搜索参数)

$('.Pagination a').each(function () {
   this.onclick = function (e) {
       if ( e && e.preventDefault )
           e.preventDefault();
       else
           window.event.returnValue = false;
   }
   $(this).click(function () {
       var form = document.createElement('form');
       $(form).css('display','none');
       $(form).attr('action',this.href);
       $(form).attr('method','post');
       $(form).html('<input name="oinfo" value="{{$selected}}"/><input name="datekey1" value="{{$start}}"/><input name="datekey2" value="{{$end}}"/>')
       $(document.body).append(form);
       $(form).submit();
       $(form).remove();
   })
});

猜你喜欢

转载自blog.csdn.net/qq_29065191/article/details/80223103