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

new window

Status
Not open for further replies.

patweb

Programmer
Apr 17, 2003
174
BE
Code:
function writeframe(argdir, argname) 
{ 

   document.write('<html>'); 
   document.write('<head>'); 
   document.write('</head>'); 
   document.write('<frameset cols="18%,82%" framespacing="0" frameborder="0" >'); 
   document.write('<frame name="left" src= ' + argdir + ' target="rechts" scrolling="no" scrolbar="no">'); 
   document.write('<frame name="rechts" scrolling="auto" src= ' + argname + ' target="rechts">'); 
   document.write('<noframes>'); 
   document.write('<body>'); 
   document.write('</body>'); 
   document.write(' </noframes>'); 
   document.write('</frameset>'); 
   document.write('</html>'); 
}

the user chose an item in a scroll-down menu, a new page (frame) is opening. This works. Afterwards I integrate this page in my index.htm page (a frame). When I make now a choise in this scroll-down menu he opens a new page but not in a new window, but within the part of the frame where my scroll-down menu page is in. How can I activate the code above in a new window and not longer within a part of the frame ? I tried window.open() but this works with a link (a href..)



 
There is no reason you cannot use window.open with the onchange event of a select box. For example:

Code:
<select onchange="var winHandle = window.open(this.value, '', '');">
	<option value="[URL unfurl="true"]http://www.google.co.uk/">Google</option>[/URL]
	<option value="[URL unfurl="true"]http://www.yahoo.co.uk/">Yahoo!</option>[/URL]
</select>

Hope this helps,
Dan


The answers you get are only as good as the information you give!
 
indeed, he opens a new window, but I have no URL, I create the page with document.write. Without an URL the document.write page is not showed in a new window.
 

Are you trying to write the frameset [from your initial post] into the new window?

Dan


The answers you get are only as good as the information you give!

 
yes, but I do not succeed. He opens a new window, but write the code in the old frame. Can you tell me how. Should it be possible to include the document.write values as a variable (not a page) in the arguments of windows.ope(...)?
 

You need to modify your function to target the popup window:

Code:
function writeframe(argdir, argname) {
   var winHandle = window.open('', '', '');
   winHandle.document.open();

   // do all your document.write commands here, but use winHandle.document.write instead
   winHandle.document.write('<html>'); // like this

   // then finish with:
   winHandle.document.close();
}

That should work for you. There have been many posts recently about this - did you try searching the forums?

Hope this helps,
Dan


The answers you get are only as good as the information you give!

 
thanks, it works, two little questions remain (i am on the search in the threads).

1.he takes time to execute the javascript (can you accelarate the speed ?)
2. the window is not maximazed. I look for the right argument. Correction, the page is maximazed, but because he seem this as a popup, not over the complete screen.
 

1. No

2. You will not be able to do this in Win XP with IE6 and SP2 due to security restrictions.

Dan


The answers you get are only as good as the information you give!

 
window.open() arguments :

full screen = not_ok, page over complete screen.
channelmode = not_ok, buttom bar disappeared.

another function then window-open ?

 

I do not understand what you are asking. What do you want to do that window.open will not do for you?

Dan


The answers you get are only as good as the information you give!

 
full screen and channelmode are parameters for your window.open() function. I have tested then, but the result is not what I want. I just want to open my frame in a normal window, maximized, with above and under the bars.
 

What do you mean by "with above and under the bars"? I do not understand this.

Dan


The answers you get are only as good as the information you give!

 
When you use the argumest, fullscreen, your navigation bar disappeared
 

Try this:

Code:
window.open('', '', 'fullscreen,channelmode,directories,location,menubar,resizable,scrollbars,status,titlebar,toolbar');

Hope this helps,
Dan


The answers you get are only as good as the information you give!

 
var winHandle = window.open('', '','directories=yes,resizable=yes,menubar=yes,scrollbars=yes,location=yes,toolbar=yes,status=yes');

find it myself, almost perfect
 

You do not need to specify "=yes". It is assumed if you have the option listed, you want it enabled.

Dan


The answers you get are only as good as the information you give!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top