Last active
August 29, 2015 14:13
-
-
Save jasonmerino/88bf1f861972e743de09 to your computer and use it in GitHub Desktop.
Mobile Opt In/Out
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
javascript:(function () { | |
var query = window.location.search, | |
params = {}, | |
key, | |
value; | |
query = query.indexOf('?') === 0 ? query.substring(1, query.length) : query; | |
query = query.split('&'); | |
for (var i = 0; i < query.length; i++) { | |
key = query[i].split('=')[0]; | |
value = query[i].split('=')[1]; | |
params[key.toLowerCase()] = value; | |
} | |
params.mobileoptout = prompt('Enter your mobileoptout value'); | |
query = []; | |
for (key in params) { | |
query.push(key + '=' + params[key]); | |
} | |
window.location.search = '?' + query.join('&'); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment