jQuery.navigate.dsidirop
1.0.15
Package belongs to a different developer
dotnet add package jQuery.navigate.dsidirop --version 1.0.15
NuGet\Install-Package jQuery.navigate.dsidirop -Version 1.0.15
<PackageReference Include="jQuery.navigate.dsidirop" Version="1.0.15" />
paket add jQuery.navigate.dsidirop --version 1.0.15
#r "nuget: jQuery.navigate.dsidirop, 1.0.15"
// Install jQuery.navigate.dsidirop as a Cake Addin
#addin nuget:?package=jQuery.navigate.dsidirop&version=1.0.15
// Install jQuery.navigate.dsidirop as a Cake Tool
#tool nuget:?package=jQuery.navigate.dsidirop&version=1.0.15
jQuery.navigate
An abstraction on site navigation wrapped up in a jQuery plugin. When using website analytics, window.location
is not sufficient due to the referer not being passed on the request. The plugin resolves this and allows for both aliased and parametrised URLs. I also provide an API helper method, which enables quick and simple ReSTful URL building capability.
The Setup
$(document).ready(function () {
$.navigateSetup({
api: '/api/',
endpoints: {
home: '/michaelpapworth',
myAwesomePlugin: '/{user}/{repo}',
},
});
});
Usage
The examples below are based on the setup above, let's assume the root of the site is http://github.com.
How to navigate to the preconfigured endpoints?
// Address bar will read http://github.com/michaelpapworth
$.navigate('to', 'home');
$.navigate.to('home'); //alternative syntax
// Address bar will read http://github.com/michaelpapworth/jQuery.navigate
$.navigate('to', 'myAwesomePlugin', {
user: 'michaelpapworth',
repo: 'jQuery.navigate',
});
$.navigate.to('myAwesomePlugin', {
user: 'michaelpapworth',
repo: 'jQuery.navigate',
});
Want to navigate to a specific URL?
$.navigate('goTo', 'http://github.com/michaelpapworth/jQuery.navigate');
$.navigate.goTo('http://github.com/michaelpapworth/jQuery.navigate');
What about your API?
var url = $.navigate.api('resource', 123); // /api/resource/123
$.ajax({ type: 'GET', url: url }).done(function (data) {
console.log('This data came from "http://github.com/api/resource/123"');
});
I just want the URL?
// Just use the endpoints to build the URL for me
var homepageUrl1 = $.navigate('url', 'home');
var homepageUrl2 = $.navigate.url('home');
Want to roll your own or contribute?
- Fork this repository and create a new branch if you intend to contribute your work.
- Clone the branch to your computer.
- In the console
cd jQuery.navigate && npm run-script build
. - Enable the build as you save your work
npm start
.
Learn more about Target Frameworks and .NET Standard.
-
- jQuery (>= 1.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|