{"id":15509662,"url":"https://github.com/willin/pjan","last_synced_at":"2025-04-23T02:33:18.199Z","repository":{"id":3764430,"uuid":"4840790","full_name":"willin/pjan","owner":"willin","description":"Html 5 PushState + Ajax + JSON","archived":false,"fork":false,"pushed_at":"2015-04-29T09:26:28.000Z","size":128,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T16:39:36.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willin.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-30T08:01:14.000Z","updated_at":"2018-07-04T00:30:53.000Z","dependencies_parsed_at":"2022-08-17T23:00:43.042Z","dependency_job_id":null,"html_url":"https://github.com/willin/pjan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fpjan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fpjan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fpjan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2Fpjan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willin","download_url":"https://codeload.github.com/willin/pjan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250357926,"owners_count":21417378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:43:27.209Z","updated_at":"2025-04-23T02:33:18.143Z","avatar_url":"https://github.com/willin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿## 说明\r\n\r\nPJAN是在Pjax基础上加入JSON支持的插件，原作者Welefen。\r\n\r\n1.0版本详细文章： http://willin.org/ajax-u-need-2-know/\r\n\r\n作者：长岛冰泪 http://willin.org\r\n\r\n## 示例代码\r\n\r\n```js\r\njQuery(document).ready(function(w){\r\n    var $page_title='';\r\n    w.pjan({\r\n        selector: 'a',//选择器。可用jQuery筛选语法。必填。\r\n        container: '#tmpholder', //内容替换的容器，没什么实际用处。必填。\r\n        show: 'fade', //展现的动画，支持默认和fade, 可以自定义动画方式，这里为自定义的function即可。\r\n        cache: 60, //使用缓存，单位秒，0或flase取消。\r\n        storage: true, //是否使用本地存储。\r\n        titleSuffix: '- by Willin PJAN', //标题后缀\r\n        filter: function(href){\r\n            if(href.indexOf('.png') \u003e-1 || href.indexOf('.jpg') \u003e-1 || href.indexOf('.gif') \u003e-1 || href.indexOf('.rar') \u003e-1 || href.indexOf('.zip') \u003e-1 || href.indexOf('.7z') \u003e-1){\r\n                return true;//True表示过滤不用pjan\r\n            }\r\n          \r\n        },\r\n        beforeSend:function(){\r\n            //Loader动画开始\r\n        },\r\n        callback: function(status){\r\n          \r\n            var type = status.type;\r\n            switch(type){\r\n                 case 'success':  //正常\r\n                 case 'cache':\r\n                    var json=w.parseJSON(status.data);\r\n                    //手动jQuery('sth').html(json.data.sth);\r\n                    // Animate动画\r\n                    }\r\n                 break; //读取缓存\r\n                 case 'hash':\r\n                     // Animate动画\r\n                     break; //只是hash变化\r\n                 case 'error':\r\n                   \r\n                 break; //发生异常\r\n            }\r\n            //Loader动画结束\r\n        }\r\n    });\r\n});\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Fpjan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillin%2Fpjan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Fpjan/lists"}