Reply to Re: Manipulating the Browser

Your name:

Reply:


Posted by Harlan Messinger on 01/22/72 11:59

Munkeyjunkey wrote:
> 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?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация