I am using the stylesheet switcher on dynamic drive . Is there a way to change stylesheets based on a querystring parameter? Basically, if the query string includes “&StyleSheet=BlueStyle” then call and set the BlueStyle.css and cookie on page load.
Any ideas or help would be much appreciated. Thanks!!
Absolutely, you could use a function like the below:
function getUrlParam(name){
var results = new RegExp('[\\\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (!results) { return 0; }
return results[1] || 0;
}
var newStyle = getUrlParam("stylesheet");
chooseStyle(newStyle, 60)