Last active
January 4, 2016 20:29
-
-
Save brittanydionigi/8674413 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
* Helper function for getting query string parameters | |
* @param {string} name The name of the query parameter we want the value of | |
* @return {string} results Value of the query parameter | |
*/ | |
function getParameterByName(name) { | |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
/* Hide the masthead if we are in an NYT app */ | |
var qParam = getParameterByName("nytapp"); | |
if (qParam) { | |
$("#masthead").hide(); // or whatever you want to do here. some people add a class to the html or body tag to hide stuff with CSS | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment