基于 jquery 的片段异步加载 jquery-fjax

码农软件 · 软件分类 · jQuery界面效果 · 2020-01-01 09:11:52

软件介绍

jquery-fjax 页面片段异步加载

  • 基于锚点技术,支持所有浏览器,不需要浏览支持 history.pushState

  • 如果支持客户浏览器都支持 history.pushState ,建议使用 pjax

  • 需要引入 jquery 库,开发版本选用的是v2.2.1,其它版本未验证

  • QQ:16349023

    <script th:src="@{${prefixPath}+'/assets/plugins/jquery-fjax/jquery.fjax.js'}" src="/assets/plugins/jquery-fjax/jquery.fjax.js"></script>
    <script  type="text/javascript" th:inline="javascript">
    /*<![CDATA[*/
    $(function() {
        var fjax_options = {
            fragment:'#pagecontent',
            prefix:'/manage/',
            beginLoad:function () {
                console.log("begin");
            },
            endLoad:function () {
                console.log("end");
            },
            success:function () {
                console.log("success");
            },
            error:function () {
                console.log("error");
            },
            'default_url': 'main',//default hash
            'content_url': function(hash,prefix) {
                //***NOTE***
                //this is for Ace demo only, you should change it to return a valid URL
                //please refer to documentation for more info
                var hashValue=hash;
                var path = document.location.pathname;
                //var requestUrl=path + "/" +hashValue.replace(/^page\//, '');
                //var requestUrl=path + "/" +hashValue;
                console.log(prefix);
                var requestUrl=prefix+hashValue;
                console.log(requestUrl);
                return requestUrl;
            }
        }
        $('.page-content-area').fjax(fjax_options);
    });
    
    /*]]>*/
    </script>

本文地址:https://codercto.com/soft/d/22409.html

精通正则表达式

精通正则表达式

[美] Jeffrey E.F.Friedl / 余晟 / 电子工业出版社 / 2012-7 / 89.00元

《精通正则表达式(第3版)》内容简介:随着互联网的迅速发展,几乎所有工具软件和程序语言都支持的正则表达式也变得越来越强大和易于使用。《精通正则表达式(第3版)》是讲解正则表达式的经典之作。《精通正则表达式(第3版)》主要讲解了正则表达式的特性和流派、匹配原理、优化原则、实用诀窍以及调校措施,并详细介绍了正则表达式在Perl、Java、.NET、PHP中的用法。《精通正则表达式(第3版)》自第1版开......一起来看看 《精通正则表达式》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

MD5 加密
MD5 加密

MD5 加密工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具