{"id":15509690,"url":"https://github.com/willin/instantpjax","last_synced_at":"2025-04-23T02:42:21.078Z","repository":{"id":30938631,"uuid":"34496649","full_name":"willin/InstantPjax","owner":"willin","description":"A jQuery Plugin for PJAX with instantclick.","archived":false,"fork":false,"pushed_at":"2015-10-21T01:25:17.000Z","size":252,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T16:41:13.440Z","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":"mit","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-24T03:49:03.000Z","updated_at":"2024-10-25T10:54:13.000Z","dependencies_parsed_at":"2022-09-08T11:51:36.972Z","dependency_job_id":null,"html_url":"https://github.com/willin/InstantPjax","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2FInstantPjax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2FInstantPjax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2FInstantPjax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willin%2FInstantPjax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willin","download_url":"https://codeload.github.com/willin/InstantPjax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360242,"owners_count":21417716,"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:29.902Z","updated_at":"2025-04-23T02:42:21.059Z","avatar_url":"https://github.com/willin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InstantPjax\n\nNot for noob.\n\n## Installation\n\n```shell\nbower install instantpjax\n```\n\nor download here: \n\n[https://github.com/willin/InstantPjax/releases](https://github.com/willin/InstantPjax/releases)\n\nor use directly: \n\n[https://rawgit.com/willin/InstantPjax/dist/instantpjax.min.js](https://rawgit.com/willin/InstantPjax/dist/instantpjax.min.js)\n\n## Usage\n\nFirst of all, you need to require this js.\n\n```html\n\u003cscript src=\"https://rawgit.com/willin/InstantPjax/dist/instantpjax.min.js\" type=\"application/javascript\" data-no-ipjax\u003e\u003c/script\u003e\n```\n\n### Ignore Elements\n\nUse `data-no-ipjax` attribute like:\n\n```html\n\t\u003ch1 data-no-ipjax\u003eHello World\u003c/h1\u003e\n```\n\n### 1. Basic\n\nUse: `$.fn.ipjax`\n\n```js\n\t/*selector,container,config*/\n\t$(document).ipjax('a','#main',{\n\t\ttimeout: 10000, //ms\n\t\tcache:  3600*24*7, //s, 0 for disable cache\n\t\tcacheIgnore: ['/','/news'], //paths that do not cache, default: false\n\t\tstorage: true, //false for disable localStorage\n\t\tdelay: 300, //ms, 0 for disable mouse over preloading\n\t\tpush: true, // true is push, false is replace, null for do nothing\n\t\ttitleSuffix: '', \n\t\tshow: '', // _default/fade or Animation Function(data, callback, isCached)\n\t});\n\t$(document).on('ipjax.start',function(){\n\t\t//start animation here\n\t\t// Example:\n\t\t/*\n\t\t$('#loading').show();\n\t\t*/\n\t});\n\t$(document).on('ipjax.end',function(){\n\t\t//end animation here\n\t\t// Example:\n\t\t/*\n\t\t$('#loading').hide();\n\t\t*/\n\t});\n\t$(document).on('ipjax.cached',function(){\n\t\t//if cached animation here\n\t\t// Example:\n\t\t/*\n\t\t$($.ipjax.options.element).addClass('cached');\n\t\t$($.ipjax.options.element).one('mouseleave',function(){\n\t\t  $(this).removeClass('cached');\n\t\t});\n\t\t*/\n\t});\n```\n\n### 2. Manual Request\n\nSee [jQuery.ajax/#jQuery-ajax-settings](http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings)\n\n```js\n\t$.ipjax({\n\t\turl: '',\n\t\tcontainer: '#main',\n\t\ttimeout: 10000, //ms\n        cache:  3600*24*7, //s, 0 for disable cache\n        storage: true, //false for disable localStorage\n        delay: 300, //ms, 0 for disable mouse over preloading\n        push: true, // true is push, false is replace, null for do nothing\n        titleSuffix: '', \n        show: '', // _default/fade or Animation Function(data, callback, isCached)\n        type:'GET',\n        dataType: 'html',\n        data:{\n            ipjax: true\n        }\n\t});\n```\n\n### 3. Advanced Custom Show Animation\n\nExtends `$.ipjax.showFx`:\n\n```js\n$.extend($.ipjax.showFx,{\n\t// Codes Here\n\t// Example:\n\t/*\n    animation:function(data, callback, isCached) {\n      this.html(data);\n      callback \u0026\u0026 callback.call(this, data, isCached);\n    }\n    */\n});\n```\n\nThen use like this:\n\n```js\n$(document).ipjax('a','#main',{\n\t// Example:\n\tshow: 'animation'\n});\n```\n\n### APIs\n\n#### $.support.ipjax\n\nCheck `ipjax` plugin\n\n#### $.support.storage\n\nCheck `localStorage` \n\n## Compatibility\n\nUse `json2.js` for JSON.parse with IE 6~8\n\nSee: [https://github.com/douglascrockford/JSON-js](https://github.com/douglascrockford/JSON-js) for details.\n\n```html\n\u003c!--[if lte IE 8]\u003e\n\t\u003cscript type=\"application/javascript\" src=\"https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js\"\u003e\u003c/script\u003e\n\u003c![endif]--\u003e\n```\n\n## Tests\n   \nTests (in the `tests` folder) are PHP-generated HTML pages with which to check how InstantClick behaves on different browsers. That’s what I use before releasing a new version to make sure there are no obvious regressions.\n\nTo access the suite of tests, run `php -S 127.0.0.1:8000` from the project’s root directory (**not** from the `tests` folder) and head to [http://127.0.0.1:8000/tests/](http://127.0.0.1:8000/tests/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Finstantpjax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillin%2Finstantpjax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillin%2Finstantpjax/lists"}