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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Onload Options

Status
Not open for further replies.

SoyDelicious

Technical User
Jul 23, 2002
46
US
I want to kill the toolbar, status and resize options for onload, is there a way I can do this. Or is there a tutorial somewhere that I can read that would be benefical?
 
So when your page loads, you want to trap the user there and not let them navigate to another site short of closing and restarting their browser?
 
You can probably call the window.open function through javascript on load event of your main page, close the parent and pop up another window without toolbar, etc. Just keep in mind that all this becomes useless when the user hits Clrl-N key, which will open the same window within the same session but with all preferences, such as toolbar, address bar and so on.
 
Its more of a look thing.....I attempted a body onload=window.open("index.html", "Santas Helper","toolbar=no, statusbar=no, resize=no"); although it didn't work....does this syntax look ok, I also have another onload command in the body section of the page. Will the two interfere with each other?
 
>> does this syntax look ok

No. If you have spaces in your attributes you have to enclose the entire attribute in quotes. If you use double quotes to surround the attribute, you should use single quotes to delimit string literals within your attribute. Try:
[tt]
onload="window.open('index.html', 'Santas Helper','toolbar=no, statusbar=no, resize=no');"
[/tt]
instead.

>> I also have another onload command in the body section of the page. Will the two interfere with each other?

It depends on exactly where the onload directive is placed. In particular, which element it refers to. It's possible to have different onload handlers for different elements. But if you've placed both onload handlers in the <body> tag itself, then yes, they will interfere with one another. Only the second one will be executed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top