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

x
?
Solved

Cannot set title for window.open for MS IE 7

Posted on 2007-03-24
10
Medium Priority
?
1,681 Views
Last Modified: 2007-11-27
Hi,

I would like to set a title (e.g. MY TITLE) that will appear on top of MS Explore 7 window.  I open this window from a parent window.  I tried the following, but they seem to not work:
In my JavaScript:

1.     wRef = window.open(url, 'MY TITLE',    
"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=850,height=700");

2.       wRef.document.title = "MY TITLE";

3.     document.title = "MY TITLE";
0
Comment
Question by:akoifman
  • 4
  • 4
8 Comments
 
LVL 10

Expert Comment

by:Jaax
ID: 18787308
In window.open(url, "MY TITLE", ...) , the argument for which you set the value as "MY TITLE" is actually the Window Name.
To set the title, in the HTML page you need to specify it inside  the <TITLE></TITLE>
0
 

Author Comment

by:akoifman
ID: 18787316
I need the window name to be set dynamically from the parent window (parent knows the name).
0
 
LVL 10

Accepted Solution

by:
Jaax earned 1000 total points
ID: 18787370
winHan = window.open()
winHan.document.title="My Title" works in IE 6 but not in FF. Is your popped-up page JSP/ASP or just a static HTML. If it is an dynamically generated page like JSP/ASP, then you would pass title as a parameter to the popped-up window.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:akoifman
ID: 18788121
Hi Jaax,

I used JSP:

in MS IE & I see window name:
http://lab13-20.ibrix.com:8080/index2.jsp?TITLE=MY TITLE

It looks fine in XP's Taskbar and FF on LINUX.  What is this extra stuff in window's name: http://lab13-20.ibrix.com:8080/index2.jsp?

This is the code: <title> "<%= request.getParameter("TITLE")%>" </title>

DId I have to add any other tags (I am not very familiar with JSP)?
0
 

Author Comment

by:akoifman
ID: 18788292
Hi Jaax,

I think I looked at the wrong place.  The JSP code does set the window title.  I was just looking at the link just below it.

Thanks.
0
 
LVL 10

Expert Comment

by:Jaax
ID: 18790860
If your pop-up is in fact a JSP page, then your problem is already solved.

Also please use encodeURI to encode your URL which uses spaces
encURl = encodeURI("http://lab13-20.ibrix.com:8080/index2.jsp?TITLE=MY TITLE");


0
 

Author Comment

by:akoifman
ID: 18792347
It seemed to work without encodeURI.  After I use encodeURI isee the "ugly" % symbols in the path.  When do I really need it?  

Thanks.
0
 
LVL 10

Expert Comment

by:Jaax
ID: 18792530
If it works without using encodeURI, then why bother ;)
I hope your problem is solved.

And just to complete of what was mentioned previously in my post
>Also please use encodeURI to encode your URL which uses spaces
>encURl = encodeURI("http://lab13-20.ibrix.com:8080/index2.jsp?TITLE=MY TITLE");

At the JSP end, the encoding has to be complemented by decoding
As
<title><%= URLDecoder.decode(request.getParameter("TITLE"),"UTF-8")%></title>

In your page directive append the following package
<%@page import=" ....,java.net.URLDecoder" %>
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 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