1、锚点跳跃

HTML:

<div class="page_title"  id="maodian">
    <h1>客房节日价格管理</h1>
</div>

<td><a ref="{$v['h_id']}"  href="javascript:void(0);" class="button"><span class="trash icon"></span>编辑</a>    //2、href不加跳跃,在下面js有其他事件(ajax)
</td>

JS:

<script type="text/javascript">    
$(function(){
        $("td a").click(function(){
            $(this).attr('href',"#maodian");//瞄点链接替换,非常重要
            var h_id = $(this).attr("ref");
            //alert(h_id);
            if(h_id){
                //同步ajax的POST方式进行请求数据
                $.ajax({
                                    //...
                });
            }else{
                alert('请选择有效的房间id');    
            }
        })
    })
</script>    

 

相关文章:

  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2021-08-28
  • 2022-12-23
猜你喜欢
  • 2022-02-09
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-02-27
相关资源
相似解决方案