Posts Purl
Post
Cancel

Purl

A JS utility for for parsing URLs and extracting information out of them.

https://github.com/allmarkedup/purl

//or

```js //read event ID var eventname = GetURLParameter(‘event’);

//////////////////////// //read URL parameter //////////////////////// function GetURLParameter(sParam) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split(‘&’); for (var i = 0; i < surlvariables.length; i++) { var sparametername = surlvariables[i].split(‘=’); if (sparametername[0] == sparam) { return sparametername[1]; } } } surlvariables.length;="" i++)="" {="" var="" sparametername="sURLVariables[i].split('=');" if="" (sparametername[0]="=" sparam)="" {="" return="" sparametername[1];="" }="" }="" }=""></ surlvariables.length; i++) { var sparametername = surlvariables[i].split('='); if (sparametername[0] == sparam) { return sparametername[1]; } } } >

origin - http://www.pipiscrew.com/?p=2741 js-purl

This post is licensed under CC BY 4.0 by the author.
Contents

Trending Tags