Products/Services Website Design DNN Web Hosting Bespoke Software Solutions
Spotlight Business Made Simple Credica Wilson Chauffeur Services Lysander Whitegrove FC Ultramagic Bracklesham Boardriders Johns Motors
DotNetNuke Modules janet.Articles janet.ReferMe! janet.Menu janet.Gallery janet.Guestbook janet.GoogleAds janet.Marquee
DotNetNuke Skins janet.VeniceGrandCanal janet.ParisSkyline janet.ColourBar
Articles HTML Javascript ASP .net DotNetNuke Web Robots
A JavaScript function to illicit the value for a parameter in a querystring. We can use JavaScript to get the various parameters from within a querystring. In the function given below I have used the JavaScript split function to break up the querystring into an array. I then use a dor loop to step through the array to find the required parameter. A second use of the split function will yield the value of the parameter
function getParameter( parameterName ) { var queryString = window.location.search.substring(1).toLowerCase(); //alert(queryString); //if (queryString.length==0) {return "null";} var parameters = new Array(); parameters = queryString.split('&'); for(var i = 0; i < parameters.length; i++) { //alert(parameters[i]); //alert(parameters[i].indexOf(parameterName)); if (parameters[i].indexOf(parameterName.toLowerCase())>=0) { //alert(parameters[i]); var parameterValue = new Array(); parameterValue = parameters[i].split('='); return parameterValue[1]; } } return "null";}
var ModuleId = getParameter('ModuleId');
I have left in place some alerts, which may be uncommented to help you in testing your use of the function.
NAT March 2006
Copyright © 2004-2007 Janet Systems Ltd.
DotNetNuke Website design and hosting from £15.00 per month. More...
Looking for a website design company in the Thames Valley, call us on 01628 566178
DotNetNuke ModulesDotNetNuke Skins
from Janet Systems