
February 26th, 2013, 06:54 PM
|
|
Contributing User
|
|
Join Date: Sep 2010
Posts: 59
Time spent in forums: 19 h 59 m 51 sec
Reputation Power: 0
|
|
|
Run automatically with the launch of a a webpage
I have this javascript program.
I have not worked much in javascript with ASP.net.
Can you get this function to run automatically with the launch of a aspx webpage and put the value in TextBox1?
Code:
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
|