Skip to content

Instantly share code, notes, and snippets.

@ABooooo
Created November 14, 2014 11:52
Show Gist options
  • Save ABooooo/41e4a902c4b885f440b8 to your computer and use it in GitHub Desktop.
Save ABooooo/41e4a902c4b885f440b8 to your computer and use it in GitHub Desktop.
Get param from URL
$(document).ready(function(){
var urlParams;
(window.onpopstate = function () {
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
urlParams = {};
while (match = search.exec(query))
urlParams[decode(match[1])] = decode(match[2]);
})();
// alert(urlParams["id"]);
if (urlParams["id"] == 'ru') {
$('body').css('font-family', "\'Helvetica Neue\', Helvetica, Arial, sans-serif");
} else {
$('body').css('font-family', "\'Alegreya Sans\', sans-serif");
$('.text ul li h1').css('font-family', "\'Alegreya Sans\', sans-serif");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment