{"id":26051077,"url":"https://github.com/kiralt/bjax","last_synced_at":"2025-04-10T19:33:39.764Z","repository":{"id":27135228,"uuid":"30603829","full_name":"KiraLT/Bjax","owner":"KiraLT","description":"Ajax link system for modern website. Convert any link in your page to ajax link.","archived":false,"fork":false,"pushed_at":"2020-08-04T18:49:24.000Z","size":752,"stargazers_count":37,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T03:58:28.470Z","etag":null,"topics":["ajax","ajax-form","ajax-library","ajax-link","jquery"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KiraLT.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-02-10T17:16:54.000Z","updated_at":"2025-02-09T00:48:54.000Z","dependencies_parsed_at":"2022-08-30T16:11:11.671Z","dependency_job_id":null,"html_url":"https://github.com/KiraLT/Bjax","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/KiraLT%2FBjax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KiraLT%2FBjax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KiraLT%2FBjax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KiraLT%2FBjax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KiraLT","download_url":"https://codeload.github.com/KiraLT/Bjax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281418,"owners_count":21077423,"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":["ajax","ajax-form","ajax-library","ajax-link","jquery"],"created_at":"2025-03-08T03:37:10.240Z","updated_at":"2025-04-10T19:33:39.722Z","avatar_url":"https://github.com/KiraLT.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to Bjax 1.0.2\n\nAjax link system for modern website. Convert any link in your page to ajax link.\n\nDemo online: http://bjax.6te.net/demo/\n\n**V2 development in progress. VanilaJS, fast \u0026 lightweight with form support. [Check it out](https://github.com/KiraLT/Bjax/tree/v2)**\n\n## Features\n\n* Converts any link to ajax link.\n* Loads whole page with ajax.\n* Loads part of page with ajax.\n\n## Requirements\n\n* jQuery.\n* HTML5 browser.\n\n## Usage\n\n### Download manually\n\nDownload the latest version: https://github.com/KiraLT/Bjax/releases\n\n### Download using Bower\n\n```\nbower install bjax\n```\n\nLink to the JS file:\n\n```html\n\u003cscript src=\"bjax.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nAdd the CSS file (or append contents to your own stylesheet):\n\n```html\n\u003clink href=\"bjax.min.css\" rel=\"stylesheet\" type=\"text/css\" /\u003e\n```\n\nTo initialize:\n\n```javascript\n// bind on data-bjax attributes (recommended)\n$('[data-bjax]').bjax();\n\n// bind on each link\n$('a').bjax();\n\n// or with custom settings\n$('[data-bjax]').bjax({\n    target: '#content',\n    element: '#content'\n});\n```\n\n## Settings\n\nKey | Default | Values | Description\n--- | --- | --- | ---\nurl_attribute | data-href or href | String | URL attribute \nurl | undefined | String | custom url\nreplace_attribute | data-replace | String | Replace attribute\nreplace | true | Boolean | Change page URL after bjax load\nelement_attribute | data-el | String | Element attribute\nelement | html | String | Element to load\ntarget_attribute | data-target | String | Target attribute\ntarget | html | String | Load target\n\n## HTML attributes\n\n`data-target`- jQuery selector\n\nLoad content to specified target.\n\n**Example HTML:**\n\n```html\n\u003cdiv id=\"content\"\u003e\n  \u003ca href=\"content.html\" data-target=\"#content\" data-bjax\u003eLoad here\u003c/a\u003e\n\u003c/div\u003e\n```\n\n`data-el`- jQuery selector\n\nLoad only specified element.\n\n**Example HTML:**\n\n```html\n\u003ca href=\"content.html\" data-el=\"#content\" data-bjax\u003eLoad here\u003c/a\u003e\n```\n\n`data-replace`- boolean\n\nChange URL after load dynamicaly.\n\n**Example HTML:**\n\n```html\n\u003ca href=\"home.html\" data-replace=\"false\" data-bjax\u003eHome\u003c/a\u003e\n```\n\n`data-url`- string\n\nCustom load URL. Will be used instead of href attribute.\n\n**Example HTML:**\n\n```html\n\u003cbutton data-url=\"home.html\"  data-bjax\u003eHome\u003c/button\u003e\n```\n\n## API `Bjax`\n\nYou can instantiate the Bjax also through a classic way:\n\n```javascript\n// Collect settings from element\nnew Bjax($('[data-bjax']));\n\n// Set settings manually\nnew Bjax({\n  'target': '#target',\n  'element': '#element',\n  'url': '/page'\n});\n\n// Mixed\nnew Bjax($('[data-bjax']), {\n  'target': '#target',\n  'element': '#element'\n});\n```\n\nBind bjax manually:\n\n```javascript\n$('[data-bjax]').on('click', function(e){\n    new Bjax(this);\n    e.preventDefault();\n});\n\n// Live bind\n$(document).on('click', '[data-bjax]', function(e){\n    new Bjax(this);\n    e.preventDefault();\n});\n```\n\nOnclick attribute\n\n```html\n\u003ca href=\"content.html\" onclick=\"new Bjax(this); return false;\"\u003eLink\u003c/a\u003e\n```\n\n# Bjax 2.0.0 (coming soon)\n\n## Links\n```js\nnew Bjax($('#my_a'), {\n  'target': '#content',\n  'element': '#content',\n  'loader': 'default'\n});\n```\n\n## Forms\n\n```js\nnew Bjax($('#my_form'), {\n  'target': '#content',\n  'element': '#content',\n  'method': 'post',\n  'loader': 'default'\n});\n```\n\n## Events\n\n```js\nvar bjax = new Bjax($('#my_a'));\nbjax.on('loader:start', function() {\n    $('body').addClass('dim')\n}).on('loader:end', function() {\n    $('body').removeClass('dim')\n});\n```\n\n## Custom rendering\n\n```js\nnew Bjax($('#my_a'), {\n  'target': '#content',\n  'element': '#content'\n}).on('render', function(content) {\n    return '\u003cb\u003e' + content + '\u003c/b\u003e';\n})\n```\n\n## Custom loaders\n\n```js\nBjax.registerLoader('modern', MyModernLoader);\n```\n\n*More customization*\n\n## Custom builds\n\n* jQuery\n* zepto.js\n* vanillaJS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiralt%2Fbjax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiralt%2Fbjax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiralt%2Fbjax/lists"}