JS: Location Object
/*
* The Location Object
* The location object contains information about the current URL.
* http://www.w3schools.com/jsref/obj_location.asp
*/
// Immediately Invoked Function Expression
(function($) {
$(function() {
var currentURL = $(location).attr('href'), // Get current url
referrer = document.referrer; //Return referrering document
//console.log(currentURL);
// Returns the position of the first occurrence
// of a specified value in a string.
if(currentURL.toLowerCase().indexOf('/value') >= 0) {
// Add function
}
});
}(jQuery));