JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 13th, 2003, 04:11 AM
kinetic1904 kinetic1904 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 kinetic1904 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to kinetic1904
Change window size and nav bar status on page load

Hi all,

I am newbie in js.

Is it possible to change window size (eg. 640 x 480) and disable all navigation bar, button bar etc.. when the page load.
I know it is easy to do that if I create button/link from other page to trigger this event. The problem is I can't edit the source page from the client.

Thanks and regards

Reply With Quote
  #2  
Old January 17th, 2003, 03:46 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
try the window.onload() handler.

onLoad help

Reply With Quote
  #3  
Old January 24th, 2003, 04:49 AM
kinetic1904 kinetic1904 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 kinetic1904 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to kinetic1904
Hi stumpy,

I tried using onload function... but it work only on Resize window.
My code quote as below. Can you tell me what's wrong on navigation bar control.

<html>
<head>
<title>Testing JavaScript Function</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<SCRIPT LANUAGE="JavaScript 1.2">
<!--
function RSto() {window.resizeTo(800,600)}
//-->
</SCRIPT>
<SCRIPT LANUAGE="JavaScript 1.2">
<!--
function NBar()
{
window.locationbar.visible=false;
window.menubar.visible=false;
window.personalbar.visible=false;
window.scrollbars.visible=false;
window.statusbar.visible=false;
window.toolbar.visible=flase;
}
//-->
</SCRIPT>


</head>

<body BGCOLOR="#FFFFFF" onload="RSto();Nbar()">

</body>
</html>

Tks

kinetic1904

Reply With Quote
  #4  
Old January 24th, 2003, 05:14 AM
meth meth is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 8 meth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try using a javascript link in one page <a href="javascript:testJscript();"> link</a>

to call this function in the header..


function testJscript () {
window.open("Test_Javascript_Window.html", "jstest", "height=600,width=800,channelmode=0,dependent=0,dir ectories=0,fullscreen=0,location=0,menubar=0,resiz able=0,scrollbars=0,status=0,toolbar=0");
}


Last edited by meth : January 24th, 2003 at 05:16 AM.

Reply With Quote
  #5  
Old January 24th, 2003, 09:35 AM
kinetic1904 kinetic1904 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 kinetic1904 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to kinetic1904
Hi meth,

My problem is I can't edit the link page (my client don't allow me to add js in their existing page). My design web page is only fit
in the window 640 x 480 without any navigation bar.

Can you give me any directions to complete the task beside using onload function.

Thanks for your help.

Reply With Quote
  #6  
Old January 25th, 2003, 10:07 AM
meth meth is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 8 meth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try placing something like this in the header then...

self.menubar.visible=false;
self.toolbar.visible=false;
self.locationbar.visible=false;
self.personalbar.visible=false;
self.scrollbars.visible=false;
self.statusbar.visible=false;

Reply With Quote
  #7  
Old January 26th, 2003, 10:16 PM
kinetic1904 kinetic1904 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 kinetic1904 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to kinetic1904
Hi Meth,

It didn't work...with error (self.menubar--- is null or not a object)
Anyway, thank for your help..

Now, I try another method to complete this task.
I will try using onload function to open my target window, then close self.window. However, this method has one side effect,
user will asking to confirm parent window.

So, another question is ..

Is it possible to disable "Confirm close window" button when using self.window.close() function?

Thanks

Reply With Quote
  #8  
Old January 27th, 2003, 08:38 AM
meth meth is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 8 meth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
using the self.close() method inthe new window will bypass the confirm message.

Reply With Quote
  #9  
Old March 7th, 2005, 03:35 PM
TazMan74 TazMan74 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 TazMan74 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 39 sec
Reputation Power: 0
Quote:
Originally Posted by meth
using the self.close() method inthe new window will bypass the confirm message.


So using javascript:self.close() is better than javascript:window.close()?

I just tried it & still got the confimation. Did I do something wrong? Code is below...

<a href="javascript:self.close()">Close</a>

Reply With Quote
  #10  
Old March 7th, 2005, 04:03 PM
TazMan74 TazMan74 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 TazMan74 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 39 sec
Reputation Power: 0
The word "false" was spelled wrong in your code. After fixing that I still could not get the code to work right. It gives me a java error on the body tag. <body BGCOLOR="#FFFFFF" onload="RSto();Nbar()"> Any idea what the problem could be? Thanks in advance for the help.


Quote:
Originally Posted by kinetic1904
Hi stumpy,

I tried using onload function... but it work only on Resize window.
My code quote as below. Can you tell me what's wrong on navigation bar control.

<html>
<head>
<title>Testing JavaScript Function</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<SCRIPT LANUAGE="JavaScript 1.2">
<!--
function RSto() {window.resizeTo(800,600)}
//-->
</SCRIPT>
<SCRIPT LANUAGE="JavaScript 1.2">
<!--
function NBar()
{
window.locationbar.visible=false;
window.menubar.visible=false;
window.personalbar.visible=false;
window.scrollbars.visible=false;
window.statusbar.visible=false;
window.toolbar.visible=flase;
}
//-->
</SCRIPT>


</head>

<body BGCOLOR="#FFFFFF" onload="RSto();Nbar()">

</body>
</html>

Tks

kinetic1904

Reply With Quote
  #11  
Old June 16th, 2005, 10:02 AM
sundaramkumar sundaramkumar is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 1 sundaramkumar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 37 sec
Reputation Power: 0
Send a message via Yahoo to sundaramkumar
Quote:
Originally Posted by TazMan74
So using javascript:self.close() is better than javascript:window.close()?

I just tried it & still got the confimation. Did I do something wrong? Code is below...

<a href="javascript:self.close()">Close</a>

You cannot close a window programatically which you have opened manually from the page itself.
But you close the parent window from the child window as window.opener.close();

Reply With Quote
  #12  
Old January 25th, 2006, 01:18 AM
zeeshan359 zeeshan359 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 5 zeeshan359 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 13 sec
Reputation Power: 0
i am also looking for same think

Please let me know if your query gets solved.

My code is
<body BGCOLOR="#FFFFFF" onload="window.locationbar.visible=false;window.menubar.vi sible=false;window.personalbar.visible=false;windo w.scrollbars.visible=false;window.tatusbar.visible =false;window.toolbar.visible=flase;window.resizeT o(800,600);">

Texts

</body>

From
zeeshan.theshakirs.com
Quote:
Originally Posted by TazMan74
The word "false" was spelled wrong in your code. After fixing that I still could not get the code to work right. It gives me a java error on the body tag. <body BGCOLOR="#FFFFFF" onload="RSto();Nbar()"> Any idea what the problem could be? Thanks in advance for the help.

Reply With Quote
  #13  
Old February 7th, 2006, 01:49 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
In general, I believe a webpage should not control a browser's behaviour. It is extremely confusing for the users. Correct me if I'm wrong, but a page cannot modify a browser window that is already open. You can control how a new window appears [window.open], but you can't modify the window your script is currently in.

Zeeshan, aside from the fact there's a bunch of spelling mistakes, I don't believe you can make those calls in the onload event.
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
  #14  
Old October 22nd, 2007, 12:26 PM
parag123 parag123 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 1 parag123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 11 sec
Reputation Power: 0
disable toolbar for IE

Hi

I am trying to use same code in asp.net 2.0 page which you are given below but it gives me Object expected javascript error. can you plz tell me what will be the wrong in my code.Following code which i am using.

in JS file
function test()
{
window.locationbar.visible=false;
window.toolbar.visible=false;
window.personalbar.visible=false;
window.menubar.visible=false;

}

in asp.net file .master page onload I m calling this test page.

I have included the above JS file in that master page file.

Please help me out in this.

Regards
Parag.

Quote:
Originally Posted by kinetic1904
Hi stumpy,

I tried using onload function... but it work only on Resize window.
My code quote as below. Can you tell me what's wrong on navigation bar control.

<html>
<head>
<title>Testing JavaScript Function</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<SCRIPT LANUAGE="JavaScript 1.2">
<!--
function RSto() {window.resizeTo(800,600)}
//-->
</SCRIPT>
<SCRIPT LANUAGE="JavaScript 1.2">
<!--
function NBar()
{
window.locationbar.visible=false;
window.menubar.visible=false;
window.personalbar.visible=false;
window.scrollbars.visible=false;
window.statusbar.visible=false;
window.toolbar.visible=flase;
}
//-->
</SCRIPT>


</head>

<body BGCOLOR="#FFFFFF" onload="RSto();Nbar()">

</body>
</html>

Tks

kinetic1904

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Change window size and nav bar status on page load


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap