/auto-redirection

Easy redirection for basic website.

Primary LanguageJavaScriptMIT LicenseMIT

auto-redirection version license

A pure JS, easy redirection for your website !

License | Github | Author | Site

This readme is available in : French

Installation

In your project, in head of your html simply type :

<script src="your_project_folder/src/js/redirection.js"></script>
<!-- or -->
<script src="https://gist.github.com/Sukaato/c3050455adb3483df6a52af9b9af88da.js"></script>

Basic usage

<!-- Redirecting to /lang/index.html -->
<script>new Redirection("fr-FR", "en-US").redirect("index.html")</script>

<!-- or redirecting to /lang/index.html after 2 seconds -->
<script>new Redirection(["fr-FR", "en-US"]).redirect("index.html", 2)</script>

<!-- or redirecting to https://github.com/Sukaato -->
<script>new Redirection().redirect("https://github.com/Sukaato")</script>

<!-- or redirecting to https://github.com/Sukaato after 2 seconds -->
<script>new Redirection().redirect("https://github.com/Sukaato", 2)</script>

Contributing

Big thank to TheEmrio for the new redirection system

Feel free to contribute to the project!

Please follow the guidelines when contributing!

To do

The following features are not implemented yet:

  • display the time before the redirection on the page

License

This project is licensed under the MIT License.