0.1.1 • Published 8 years ago

postwendend v0.1.1

Weekly downloads
64
License
MIT
Repository
github
Last release
8 years ago

Postwendend

Simple helper to redirect a user to a new Page via POST-Request.

How does it work?

Basically it just generates a <form> on the fly, adds the data via <input type="hidden"/> and submits the form.

Options

The follwing options are allowed

  • destination (string, required): The destination to where the user gets redirected to
  • data (object, optional): The data to be sent along
  • newWindow (boolean, optional): Whether to open the redirect in a new Tab/Window. (use this with care as most Browsers will block this as a Popup)
  • doc (document, optional): The document object to use, will fallback to the global document if not supplied with anything else

Usage

The most simple of uses would look like this:

import postwendend from 'postwendend';

postwendend('http://example.com');

And an example with some data on the way:

import postwendend from 'postwendend';

postwendend('http://example.com', {
    foo: 'bar' 
});
0.1.1

8 years ago

0.1.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago