?
Solved

Cannot set title for window.open for MS IE 7

Posted on 2007-03-24
10
Medium Priority
?
1,677 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
10 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

Technology Partners: 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!

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…
Suggested Courses

801 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