SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    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>

  2. #2
    SitePoint Member
    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

  3. #3
    SitePoint Zealot
    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.)

  4. #4
    SitePoint Member
    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.

  5. #5
    SitePoint Zealot
    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

  6. #6
    SitePoint Member
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •