🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

jetroute

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jetroute

jetRoute - Simple Route Manager

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

jetRoute - Simple Route Manager

A simple jQuery route manager for fake SPA scripts, to be implemented in a fake SPA scenarios.

When you make a single script in webpack but you need to execute the scripts on exact pages, how do you do?

Getting Started

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/jetroute.min.js"></script>
<script>
$.jetRoute.settings = {
    routes: {"[Custom Route Name]", "[Custom Route]"},
    routeType: ,
    cookieName: 
  };
  $(document).ready(function(){
      $.jetRoute("[Custom Route Name]", function (){ 
          
      });
  });
</script>

Plugin Configuration

Default Configuration

$.jetRoute.settings = {
    routes: {"[Custom Route Name]", "[Custom Route]"},
    routeType: "window"
  };

Cookie Based

$.jetRoute.settings = {
    routes: {"[Custom Route Name]", "[Custom Route]"},
    routeType: "cookie",
    cookieName: "[Cookie Name]"
  };

Function Based

$.jetRoute.settings = {
    routes: {"[Custom Route Name]", "[Custom Route]"},
    routeType: function(){
        return "[URL Route as Paths]"
    }
  };

Plugin Usage

You can call the plugin everywhere. When you need to know if the route it's the one you are on pass the callback as "return true;". When you are using it at a $(document).ready(function(){}); you can pass the callback that will be executed if it's the route you are on.

$.jetRoute("[Custom Route Name]", function (){ [Callback] });

License

Apache 2.0 © Heitor Ramon Ribeiro

Keywords

jquery-plugin

FAQs

Package last updated on 09 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts