Skip to content
This repository was archived by the owner on Jun 19, 2018. It is now read-only.

reinink/jQuery.Routy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

jQuery.Routy

Introduction

Routy is a simple jQuery plugin that allows you to tie application code to a specific page url (route) using regular expression matching. This helps organize JavaScript code in larger projects and removes the need for any in-line page identification, such an id on the body tag. Just minify all your JavaScript code into one file, and you're ready to go.

Examples

Basic usage

$.router('/calendar', function()
{
    console.log('This is the calendar page.');
});

Example using variables

$.router('/calendar/event/([0-9]+)', function(event_id)
{
    console.log('This is an event page with the id: ' + event_id);
});

Catch all example

$.router('/.*', function()
{
    console.log('This is run on every page.');
});

Questions or comments?

Send me a message on Twitter at @reinink.

About

A simple jQuery based router.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published