noimage - Download Simple jQuery Plugin For POST Or GET Redirection - redirect

Download Simple jQuery Plugin For POST Or GET Redirection – redirect

Posted on

This time I will share jQuery Plugin and tutorial about Simple jQuery Plugin For POST Or GET Redirection – redirect, hope it will help you in programming stack.

noimage - Download Simple jQuery Plugin For POST Or GET Redirection - redirect
File Size: 8.28 KB
Views Total: 11095
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

redirect is a jQuery plugin which allows to redirect the current page with nested objects and arrays to another URL via either Post or Get methods.

How to use it:

1. To use this plugin, you first have to load the jQuery redirect plugin’s script after jQuery library as this:

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="jquery.redirect.js"></script>

2. The JavaScript to redirect the page to another via default POST method.

1 $.redirect("/path/to/post.php",
2   {
3     user: "johnDoe",
4     password: "12345",
5     submit: "name"
6   },
7   "POST", "_blank");

3. All default parameters for the redirect function.

  • url – Url of the redirection
  • values – (optional) An object with the data to send. If not present will look for values as QueryString in the target url.
  • method – (optional) The HTTP verb can be GET or POST (defaults to POST)
  • target – (optional) The target of the form. “_blank” will open the url in a new window.
1 $.redirect = function (url, values, method, target)

Change log:

2018-05-30

  • v1.1.4: Delete form after submit, update docs and fix spdx license

2017-07-25

  • Add support for frames

2017-06-01

  • Fixed issues with POSTing an array of objects

2017-05-17

  • v1.0.5

2016-06-11

  • Fix for GET method

This awesome jQuery plugin is developed by mgalante. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net