MattCoatney
asked on
Javascript onload
I have a JS fun in a page that I need to run when the page loads. I can't put it in the body tag in the Master because it is only being used for one page. I tried usng an input text onload event to load the fun but it doesn't seem to work.
Ideas?
Ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ops I'm sorry, I forgot to tell you that ASP.NET has a function
to know if this scripts is already registered,
ClientScript.IsStartupScri ptRegister ed(string) ,
in my example you can use it like this,
if(!ClientScript.IsStartup ScriptRegi stered("my test"))
ClientScript.RegisterStart upScript( typeof(Page), "mytest", "<script>alert('Hello');</ script>");
Regards,
Felipe Lopes
to know if this scripts is already registered,
ClientScript.IsStartupScri
in my example you can use it like this,
if(!ClientScript.IsStartup
ClientScript.RegisterStart
Regards,
Felipe Lopes
ASKER
Appreciate both of your responses.
Ok,
I am thankful to be able to help you,
but if my question was useful to you why don't you split the points =D.
Regards,
Felipe Lopes
I am thankful to be able to help you,
but if my question was useful to you why don't you split the points =D.
Regards,
Felipe Lopes
ClientScript.RegisterStart
it is the new version of
ClientScript.IsStartupScri
an example of how to use it is:
ClientScript.RegisterStart