SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Sep 24, 2002, 06:26 #1
- Join Date
- Sep 2002
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
opening a child window and setting the title causes a unspecifed javascript error
see the code below - i want to open a new window but hide the virtual file path from users, the code only has to work in IE5.
The code works in Homesite but generates a unspecified error and did not work in the browser.
Any help is much appreciated
<script language="JavaScript">
<!--
function open_popup(page) {
var myWindow = window.open(page,'test','width=200,height=200');
myWindow.document.title = 'testpage';
return false;
}
//-->
</script>
<p>
<a href="#" onClick="return open_popup('index.html');">Open Popup</a>
</p>
-
Sep 24, 2002, 09:20 #2
- Join Date
- Sep 2002
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Need Help
I have the same problem! I would like to change the window's title after it's been opened but I get the error. Is there any way to do this? Maybe there is a work around this?
Thanks for your help,
stan
-
Sep 25, 2002, 13:45 #3
- Join Date
- Jul 2002
- Posts
- 168
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What if you put:
<script LANGUAGE="JavaScript"><!--
window.title = 'testpage';
//--></script>
or
<script LANGUAGE="JavaScript"><!--
document.title = 'testpage';
//--></script>
between the <HEAD> tags of your pop up window?
Or in script that gets executed onload of the pop up window?
(Incidentally, the example you gave worked fine as it was in IE6.)
-
Sep 26, 2002, 00:36 #4
- Join Date
- Sep 2002
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
child window
thanks for replying but that code isn't appropriate. I'm opening a word / excel doc that obviously does not contain any HTML tags, that's why I'm trying to change the title using this method.
Thanks for the information regarding IE6 unfortunately this has to work in IE5.
-
Sep 26, 2002, 18:29 #5
- Join Date
- Jul 2002
- Posts
- 168
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Noticed there's another thread about this:
http://www.sitepointforums.com/showt...threadid=77737
-
Sep 27, 2002, 01:59 #6
- Join Date
- Sep 2002
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I got this sorted out after seeing the link from the last post:
1.Solution create a frameset page
<HTML>
<title>TESTING<</title>
<FRAMESET COLS="100%">
<FRAME SRC="" name="page">
<\/FRAMESET>
</HTML>
2.In mainpage open the frameset
<script language="JavaScript">
<!--
function open_popup(frame) {
var myWindow = window.open(frame,"test","width=200,height=200");
if (myWindow.opener == null)
myWindow.opener = self;
myWindow.page.location.href="database_model.doc";
}
-->
</script>
<p>
<a href="#" onClick="return open_popup('frame.html');">Open Popup</a>
</p>
3. Set the frame content to the document and the title is whatever you set it as in the frameset
Hope this helps if anyone has the same problem
Bookmarks