Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Javascript

Status
Not open for further replies.

arundahar

Programmer
Apr 27, 2001
53
GB
How do i run a piece of Javascript that has no User participation? I know how to do all the onclick, onsubmit stuff but here's what i need to do...

My page processes loads of ASP, at some point it gets the name of a product. I want to call the simple document.title, to change the title of the page to the product title. The thing is the User is not clicking on anything and the ASP processing occurs right down the page.

Any ideas?

A
 
all functions are run when the page is opened and if the function does not requir user action the event will occure while loading the page. For instance a setfocus() function is read when the page is opened and the cursor is placed in the field the function states. Remember all javascript goes in the head and that ensures it will be read on opening. Does that help. Ted
 
not really! i knew that. How do you set the focus of the entire page? That way as soon as the page loads and the user moves his mouse i can fire up a function to change the title....

A
 
try this:

<script language=&quot;JavaScript&quot;> <!--
function newTitle(myTitle)
{
parent.document.title = myTitle;
}

window.onload = newTitle('Our bladibla products');

//--> </script>

BobbaFet Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top