Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Setting Window Features with JS

Setting Window Features with JS
Thread Tools
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jul 15, 2003, 10:04 AM
 
Can you set the windows features (i.e. no scroll, no navigation bar, etc..) via a js line in the head?

window.location.????

or do a have to call a function after load?
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jul 15, 2003, 12:24 PM
 
I don't think you can do this once the window has already been opened. You can do it in the call that opens the window, but I don't think you can do it otherwise.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jul 15, 2003, 01:12 PM
 
Hmmm....I've done this to resize or redirect a window. Are you sure?

Wish my JS book wasn't packed away :-(
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 15, 2003, 02:02 PM
 
here you go:


hide each of the six bars:

window.locationbar.visible=false
window.menubar.visible=false
window.personalbar.visible=false
window.scrollbars.visible=false
window.statusbar.visible=false
window.toolbar.visible=false


this is copyed directly out of javascript bible... they say in netscape you need to put these lines in:

before:

netscape.security.PrivilegeManager.enablePrivilege ("UniversalBrowserWrite")

after:

netscape.security.PrivilegeManager.disablePrivileg e("UniversalBroowserWrite")


hope that does it

--will
     
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jul 15, 2003, 03:30 PM
 
Once again! THANKS WIL!
     
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jul 15, 2003, 04:53 PM
 
Hmmm .... so I put this in the head:

[script type="text/javascript" name="Set_Window"][!--
netscape.security.PrivilegeManager.disablePrivileg e("UniversalBrowserWrite")

window.locationbar.visible=false
window.menubar.visible=false
window.personalbar.visible=false
window.scrollbars.visible=false
window.statusbar.visible=false
window.toolbar.visible=false

netscape.security.PrivilegeManager.enablePrivilege ("UniversalBrowserWrite")
// --]
[/script]

and it doen'y seem to work ... hmmmm
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 15, 2003, 05:56 PM
 
will it work with the enable above and the disable below?

--will
     
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jul 15, 2003, 10:35 PM
 
Nope .. atleast not in IE or Safari, haven't pulled out Camino yet, but at this point it doesn't matter.

hmmm ... if I used a function that would mean that i have to have an onload, which might look rather odd.

Any ideas? I could always dump the pages into a single frame, but that's what I'm trying to remove ... any use of frames.
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 15, 2003, 10:49 PM
 
ok, first off apperantly it should have been .visibility not .visible (my bad) but that only will work in netscape

there is probably some way to do it with:

window.open("whatever.html","_self","toolbar=no")

if you call the window "_self" it will open in the same window... but in my test it didn't actually hide the tool bar.

(easy way to execute javascript is to set your location to: javascript:script so you can paste javascript:window.open("http://www.apple.com","_self","toolbar=no") into your location bar to test it out)

--will
     
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jul 16, 2003, 12:04 PM
 
I think I'm going to put this on the back burner for now ... maybe the next revison/tweek.

I was attempting to elimante scrolling as well as address my preloading issues.

I've decide to go back to my old technique of using two frames ... the left set to 0 will contain my preloaded/always loaded items and the right will eliminate the scroll bars.


Now if I can come up with a simple way of dynamically building pages :-) doc.write? ... hmmm since my nav bar is now out of the side frame it's got to be placed inside all my pages ... ouch!

Thanks again for the help :-)
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 16, 2003, 08:12 PM
 
you probably either want to do something dynamicly on the server (serverside includes / php / perl...) or if you can't you might consider iFrames, that way you can update your navigation page in one place

--will
     
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Jul 17, 2003, 08:08 AM
 
Thanks Wil, I think I'm going to reinsert my previous preloading technique and finish off the content first then do some research on iFrames.

How well is it supported? iFrames = Layers?
     
Dedicated MacNNer
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 17, 2003, 11:23 AM
 
iframe stands for inline frame, and all current browsers support them.

w3 definition:
http://www.w3.org/TR/REC-html40/pres...es.html#h-16.5


--will
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2