{"id":14975469,"url":"https://github.com/mgalante/jquery.redirect","last_synced_at":"2025-05-16T13:04:35.330Z","repository":{"id":43124508,"uuid":"8958129","full_name":"mgalante/jquery.redirect","owner":"mgalante","description":"jQuery Redirect Plugin","archived":false,"fork":false,"pushed_at":"2022-11-21T19:15:00.000Z","size":131,"stargazers_count":206,"open_issues_count":3,"forks_count":235,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-09T09:33:58.878Z","etag":null,"topics":["cdn","form","http","javascript","jquery","jquery-plugin","post","redirect-plugin","yarn"],"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/mgalante.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":"2013-03-22T18:24:13.000Z","updated_at":"2024-07-31T00:26:00.000Z","dependencies_parsed_at":"2022-08-28T06:03:10.820Z","dependency_job_id":null,"html_url":"https://github.com/mgalante/jquery.redirect","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgalante%2Fjquery.redirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgalante%2Fjquery.redirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgalante%2Fjquery.redirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgalante%2Fjquery.redirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgalante","download_url":"https://codeload.github.com/mgalante/jquery.redirect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535826,"owners_count":22087398,"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":["cdn","form","http","javascript","jquery","jquery-plugin","post","redirect-plugin","yarn"],"created_at":"2024-09-24T13:52:05.011Z","updated_at":"2025-05-16T13:04:35.312Z","avatar_url":"https://github.com/mgalante.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery.redirect\nA simple HTTP POST and GET Redirection Plugin for jQuery\n\n* Easy to use\n* GET and POST requests\n* Compatible with jQuery, jQlite and Zepto.js\n* Supports nested objects and arrays\n\n## How does it work?\nThe function jQuery.redirect will create a form and populate it with the data (it supports nested values).\n\n## Installation\n\n### Using Bower\n\n ```bash\nbower install jquery.redirect\n ```\n\n### Using NPM\n\n ```bash\nnpm install --save jquery.redirect\n ```\n\n### Using Yarn\n\n ```bash\nyarn add jquery.redirect\n ```\n\n### Manual Installation\nJust download jquery.redirect.js and include it in your html after jquery.js\n\n ```html\n \u003chtml\u003e\n \u003chead\u003e\n     \u003c!-- other headers --\u003e\n     \u003cscript src=\"jquery-XXX.js\"\u003e\u003c/script\u003e\n     \u003cscript src=\"jquery.redirect.js\"\u003e\u003c/script\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n     \u003c!-- your content --\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n ```\n## CDN\nIf you prefer, you can use [RawGit CDN hosted version](https://cdn.rawgit.com/mgalante/jquery.redirect/master/jquery.redirect.js)\n\n\n## Usage\n ```javascript\n/**\n * jQuery Redirect\n * @param {string} url - Url of the redirection\n * @param {Object} values - (optional) An object with the data to send. If not present it will look for values as QueryString in the target url.\n * @param {string} method - (optional) The HTTP verb can be GET or POST (defaults to POST)\n * @param {string} target - (optional) The target of the form. If you set \"_blank\" will open the url in a new window.\n * @param {boolean} traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array.  This allows arrays to work with MVC.net among others.\n * @param {boolean} redirectTop - (optional) If its called from a iframe, force to navigate the top window.\n * @param {boolean} shouldKeepBlankFields - (optional) If shouldKeepBlankFields is false, blank fields will be removed.\n */\n$.redirect(url, [values, [method, [target, [traditional, [redirectTop, [shouldKeepBlankFields]]]]]])\n\n/**\n* jQuery Redirect\n* @param {string} opts - Options object\n* @param {string} opts.url - Url of the redirection\n* @param {Object} opts.values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url.\n* @param {string} opts.method - (optional) The HTTP verb can be GET or POST (defaults to POST)\n* @param {string} opts.target - (optional) The target of the form. \"_blank\" will open the url in a new window.\n* @param {boolean} opts.traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array.  This allows arrays to work with MVC.net among others.\n* @param {boolean} opts.redirectTop - (optional) If its called from a iframe, force to navigate the top window.\n* @param {boolean} opts.shouldKeepBlankFields - (optional) If shouldKeepBlankFields is false, blank fields will be removed.\n*/\n$.redirect(opts)\n ```\n\n## Example of use with Object\n\n ```html\n \u003chtml\u003e\n \u003chead\u003e\n     \u003c!-- other headers --\u003e\n     \u003cscript src=\"jquery-XXX.js\"\u003e\u003c/script\u003e\n     \u003cscript src=\"jquery.redirect.js\"\u003e\u003c/script\u003e\n     \u003cscript\u003e\n      jQuery(function($){\n      //OnClick testButton do a POST to a login.php with user and pasword\n       $(\"#testButton\").click(function(){\n        $.redirect(\"/login.php\", {user: \"johnDoe\", password: \"12345\"}, \"POST\", \"_blank\");\n       });\n      });\n     \u003c/script\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n    \u003cbutton id=\"testButton\"\u003eTest Redirect\u003c/button\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n ```\n\n\n## Example of use with links\n\n ```html\n \u003chtml\u003e\n \u003chead\u003e\n     \u003c!-- other headers --\u003e\n     \u003cscript src=\"jquery-XXX.js\"\u003e\u003c/script\u003e\n     \u003cscript src=\"jquery.redirect.js\"\u003e\u003c/script\u003e\n     \u003cscript\u003e\n      jQuery(function($){\n      //OnClick link do a POST to a login.php with query string\n      // data (user and pasword in this case)\n       $(\"body\").on(\"click\",\".post-redirect\", function(){\n         $.redirect($(this).attr(\"href\"));\n       });\n      });\n     \u003c/script\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n    \u003ca href=\"/login.php?user=johnDoe\u0026password=12345\" class=\"post-redirect\"\u003eTest redirect\u003c/a\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n ```\n\n\n## Running Tests with Yarn\n\n ```bash\nyarn install\nyarn test\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgalante%2Fjquery.redirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgalante%2Fjquery.redirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgalante%2Fjquery.redirect/lists"}