Created
November 14, 2014 11:52
-
-
Save ABooooo/41e4a902c4b885f440b8 to your computer and use it in GitHub Desktop.
Get param from URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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