Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

New window in JSP

Hi,

Scenario 1) I have a html page (say default.htm) which has some buttons on it. Onclick of the button, it opens a JSP in new window - works fine.

Scenario 2) My requirement wants to disable resize button on the default.htm. So, i created a new page (new.htm) which will be thrown by default.htm. This new.htm will have the same functionality as the previous page and will have the resize button disabled.

Now, when i try to open the JSP page by selecting the button, the JSP page is opening in the same window. Why is this opening in the same window? I actually want this to open in a separate window as it worked in scenario 1.

could someone help me out?

thanks,
joe
0
joesat
Asked:
joesat
  • 13
1 Solution
 
knightEknightCommented:
I don't know what you mean by "resize button" ... but when you want to open a page in a new window, give it a different name.  The name is the second parameter below:

  var win1 = window.open("page1.jsp","win1");
  var win2 = window.open("page2.jsp","win2");

alternatively, you can do this using target:

  <A href="page1.jsp" target="win1">Win 1</a>
  <A href="page2.jsp" target="win2">Win 2</a>

0
 
joesatAuthor Commented:
There are 3 buttons in the right size top corner of the browser, right? I meant the middle button.

joe
0
 
knightEknightCommented:
You cannot control that programmatically with client script.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
knightEknightCommented:
but you can set your window parameters to the correct size, and then make sure the window always stays that size ... is that sufficient?
0
 
knightEknightCommented:
var win1 = window.open("page1.jsp","win1","width=300,height=200,resizable=no");
 var win2 = window.open("page2.jsp","win2","width=300,height=200,resizable=no");

0
 
knightEknightCommented:
hush my mouth ... it can be done:

var win1 = window.open("page1.jsp","win1",
                                     "width=300,height=200,resizable=no,menubar=no,titlebar=no,toolbar=no,location=no");
0
 
knightEknightCommented:
let me know if that works for you.
0
 
knightEknightCommented:
ping
0
 
knightEknightCommented:
ping
0
 
knightEknightCommented:
ping
0
 
knightEknightCommented:
hello? did this help?
0
 
knightEknightCommented:
:-/
0
 
knightEknightCommented:
var win1 = window.open("page1.jsp","win1",
                       "width=300,height=200,resizable=no,menubar=no,titlebar=no,toolbar=no,location=no");
0
 
objectsCommented:

Try setting your target to "_blank".
0
 
knightEknightCommented:
only a B?  did you want something more?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 13
Tackle projects and never again get stuck behind a technical roadblock.
Join Now