Manipulating the Browser

M

Munkeyjunkey

I am trying to manipulate my browser so that when the frames page loads
it doesn't show all the toolbars, but it isn't working. Below is the
code I have:

<!--
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<script language="JavaScript">
window.onload=change;

function change()
{
var windowAttributes;

windowAttributes = 'scrollbars=no';
windowAttributes += 'toolbar=no';
windowAttributes += 'menubar=no';

var windowAttributes += 'top=0';
windowAttributes += 'left=0';
windowAttributes += 'width=900';
windowAttributes += 'height=800';
}
</script>
<title>New Page 2</title>
</head>
!-->

Any ideas on what I am doing wrong?
Thanks
Munkeyjunkey
 
H

Harlan Messinger

Munkeyjunkey said:
I am trying to manipulate my browser so that when the frames page loads
it doesn't show all the toolbars, but it isn't working. Below is the
code I have:

<!--
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<script language="JavaScript">
window.onload=change;

function change()
{
var windowAttributes;

windowAttributes = 'scrollbars=no';
windowAttributes += 'toolbar=no';
windowAttributes += 'menubar=no';

var windowAttributes += 'top=0';
windowAttributes += 'left=0';
windowAttributes += 'width=900';
windowAttributes += 'height=800';
}
</script>
<title>New Page 2</title>
</head>
!-->

Any ideas on what I am doing wrong?

Almost everything.

First of all, your users have their browsers set up the way they want
them. Who are you to decide that they shouldn't have toolbars or menu
bars or scrollbars in their browsers? I'm not sure that you can change
those configurations at all on an open window anyway. And on the rare
occasion that I've visited a site that changed my browser's dimensions,
I've left the site immediately, annoyed and nervous about what else the
site's creator might think it's OK to do to my machine.

Besides that, you're defining a Javascript variable with "var", local to
the "change" function, called windowAttributes. Then you're setting it
equal to:

"scrollbars=notoolbar=nomenubar=no"

Then you're creating the same variable AGAIN with "var" and appending

"top=0left=0width=900height=800"

Assuming the function executes beyond the redefinition (or at all),
which I think it won't, at the end of the function you have a local
variable containing a string of characters, and then that variable
disappears when execution returns from the function. What makes you
think that the browser configuration will change because you assigned a
string to a local variable?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top