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

How to open a window at the designated target w/ different features?

Status
Not open for further replies.

lcs01

Programmer
Aug 2, 2006
182
US
Hi, Experts,

Due to the length limitation on the subject line, I have to cut it short. My actual question is

How to open a new window at the designated target window with different features?

Here is the detail:

A web page (on parent window) has two links. If you click link 1, you'll get a new child window with a fixed target name. And this child window has its feature set to toolbar=no,menubar=no. -- I know how to do this.

If you click link 2, by design, it should open a new window on the same target with its feature set to toolbar=yes,menubar=yes. -- This is the one I do not know how to implement.

Here is the piece of my code:

Code:
function myOpenPage(link,page) {
  if(link == 1) { // just an example
    window.open(page,'dummy','toolbar=no,menubar=no');
  }
  else if(link == 2) {
    window.open(page,'dummy','toolbar=yes,menubar=yes'); //case 1  
    //window.open(page,'dummy'); // case 2
  }
}

If my implementation is like case 1, then the new window has a different target, even if I explicitly set the target as 'dummy'. But this new window does have toolbar and menubar as expected.

If my implementation is like case 2, then the new window does go to the same target as expected. However, it does not have toolbar and menubar.

Can someone help me on this? I have been struggling for hours and could not make it work.

Many thanks in advance!
 
I just found a typo in my implementation.

What's wrong:

Code:
  else if(link == 2) {
    window.open(page,'[b]dumy[/b]','toolbar=yes,menubar=yes'); //case 1  
    //window.open(page,'dummy'); // case 2
  }

I fixed that typo (should be 'dummy') and now 'case 1' and 'case 2' behave the same, i.e. it opens a new window at the right target but without toolbar and menubar.

Sorry for the confusion and thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top