Solved

New window in JSP

Posted on 2002-07-19
15
253 Views
Last Modified: 2010-04-01
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
Comment
Question by:joesat
  • 13
15 Comments
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
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
 

Author Comment

by:joesat
Comment Utility
There are 3 buttons in the right size top corner of the browser, right? I meant the middle button.

joe
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
You cannot control that programmatically with client script.
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
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
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
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
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
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
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
let me know if that works for you.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
ping
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
ping
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
ping
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
hello? did this help?
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
:-/
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 200 total points
Comment Utility
var win1 = window.open("page1.jsp","win1",
                       "width=300,height=200,resizable=no,menubar=no,titlebar=no,toolbar=no,location=no");
0
 
LVL 92

Expert Comment

by:objects
Comment Utility

Try setting your target to "_blank".
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
only a B?  did you want something more?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now