js-局部刷新(无缓存)

来源:互联网 发布:nba历史最强中锋知乎 编辑:程序博客网 时间:2024/05/20 11:23

方法1:(添加时间戳)


实例:

html:

      <div class="lright stripctn">
            <div class="strip">
                <div class="stripi">
                    <div id="show_pk_info_box"></div>
                </div>
            </div>
        </div>


js:

  $(function(){

        $("#show_pk_info_box").load(( '<@app.url href="student/pk/info-1.shtml"/>' )  + '?_=' + ( new Date().getTime() ));

});


添加时间戳以后,每次就都是新的了,这样就可以解决掉了缓存的问题了,你可以亲手试试啊!