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

remote call for window.open HELP! 2

Status
Not open for further replies.

ropey

MIS
Jun 8, 2001
12
0
0
CA
Hello
I am having a problem with a call from a dhtml menu that uses a off page script. The menu is called hiermenu. The off page js file works fine with:
"javascript:window.open('this code
however, I can not seem to create the same result with height and width statements
"javascript:window.open(' width=400')"
can anyone tell me why this might be?
thanks to all
 
You're missing one parameter...

Code:
<html>
<script language=&quot;javascript&quot;>

 function OpenSite(sURL){ 
  var winOpen = window.open(sURL,null,&quot;height=330,width=400&quot;);
 }

</script>

<body>
Method 1:
<input type=button value=&quot;Open Catering Site&quot; onClick=&quot;OpenSite('[URL unfurl="true"]http://www.gourmetcafecatering.com/services/weddingmenu1.htm');&quot;><br>[/URL]
Method 2:
<a href=&quot;javascript:window.open('[URL unfurl="true"]http://www.gourmetcafecatering.com/services/weddingmenu1.htm',null,'height=330,width=400');&quot;>Open[/URL] Catering Site</a>
</body>
</html>

Later, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Thanks for the response Rob, I am having this problem because I can not call the window.open from the browser page. I am using a menu driven by html/javascript and has an external call to load the menu into the index page. The call to open a browser window is from the external js file. I can send you the js files (they are from dhtml labs Hierarchial Menus) I have tried contact to no avail so it is onto the forums.
This is an array that is from the external js file:
HM_Array2_3_3 = [
[],
[&quot;Jennifer & Jason&quot;,&quot;javascript:window.open('],
[&quot;Mitch & Paula&quot;,&quot;javascript:window.open('],
[&quot;Victoria & Richard&quot;,&quot;javascript:window.open(']
]
when i use these window.open syntax there is no problem with the window opening, however it does so in full screen. I wish to have the window open in 400X600 with scrollbars
Do you have any ideas?
thanks
derek
 
hie!

>>ropey:

have u tryed RobShultz's method#2? it must be workin.
(smth like)
HM_Array2_3_3 = [
[],
[&quot;Jennifer & Jason&quot;,&quot;javascript:window.open(','',''height=330,width=400'')&quot;,1,0,0],
[&quot;Mitch & Paula&quot;,&quot;javascript:window.open(','',''height=330,width=400'')&quot;,1,0,0],
[&quot;Victoria & Richard&quot;,&quot;javascript:window.open(','',''height=330,width=400'')&quot;,1,0,0]
]
 
I am stumped guys. I have used the syntax
HM_Array2_3_3 = [
[],
[&quot;Jennifer & Jason&quot;,&quot;javascript:window.open('],
[&quot;Mitch & Paula&quot;,&quot;javascript:window.open('],
[&quot;Victoria & Richard&quot;,&quot;javascript:window.open(']
]
and all i get is the disappearance of the menu system.
I am really stumped. I have all the source code for the menu system and can send a working copy of it.
Probably the best way because then you could see how it has
been coded.
thanks for all the time and effort Rob and Vituz
derek
 
All working now!
thanks both Rob and Vituz
my mistake on method 2
my text editor (ultra edit)
took the code and replaced &quot; with '
I noticed the mistake this morning,
changed the syntax and voila.
Thanks again for your time guys
btw
do you know the code to insert scrollbars
no scrollbars are present.
derek
 
hi ropey!

about scrolls: use this code (if i unerstood u right: this code get scrollbars on the page)

<html>
<head>
<title>gettin [rid of] scrollbars</title>
</head>
<script>
function getscrlbrs(){
if (document.all) document.body.scroll='no'//<--removes scroll from da page in ie
if (document.layers) document.height=10000//<--scroll appearin in nn (2 remove it - set document.height equals or less 2 brawser window's height )
}
function getit(){
document.body.scroll='yes'//<--scroll is appearin in ie
}
</script>
<body bgcolor=&quot;#FFFFFF&quot; onclick='getit()' onload='getscrlbrs()'>
&nbsp;
</body>
</html>
 
window.open(url,target,options)
target: null, _blank, _parent, _top _self
options:
fullscreen= yes|no|1|0
height=
width=
top=
left=
location= yes|no|1|0
menubar= yes|no|1|0
scrollbars= yes|no|1|0
status= yes|no|1|0
titlebar= yes|no|1|0
toolbar= yes|no|1|0
Code:
Ex: var winOpen = window.open(&quot;myurl.html&quot;,null,&quot;width=150,height=150,top=20,left=20,scrollbars=yes&quot;)
Later, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top