SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    NY, USA
    Posts
    712
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    document title in child window

    I have written a javascript art presentation where one simply clicks from one photo to the next. They can click on any image to get an enlarged version in a child window.

    Rather than open the images directly in windows.... I use document.write() to write HTML to the new window and specify a 0 border along with the image source.

    Everything works beautifully except for one minor detail. The <title> of the child window inserts the domain name.

    So in the source code of the child window it says
    Code:
    <title>My Title</title>
    but in the title bar of the browser it says
    Code:
    http://www.mysite.com - My Title
    This is quite minor, but I'm curious if anyone knows of a way to eliminate this.

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're talking about a popup window?

    Are you assigning window.open to a variable? If so, what is the name of that vairable?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    NY, USA
    Posts
    712
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kravvitz
    You're talking about a popup window?
    yes
    Quote Originally Posted by Kravvitz
    Are you assigning window.open to a variable?
    yes
    Quote Originally Posted by Kravvitz
    If so, what is the name of that vairable?
    gPicWin

    Thanks for any advice. This is an IE problem, if that helps.

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may want to make gPicWin a global variable and then use setTimeout() to allow the popup to finish loading.

    Code:
    gPicWin.document.title = 'MyTitle';
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Everything works beautifully
    What if the user doesn't have javascript enabled?

  6. #6
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    NY, USA
    Posts
    712
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kravvitz
    You may want to make gPicWin a global variable and then use setTimeout() to allow the popup to finish loading.

    Code:
    gPicWin.document.title = 'MyTitle';
    Thanks for the advice... I'll try that. Like I said it's not a big deal I was just kind of curious more than anything. I see what you're getting at.

  7. #7
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    NY, USA
    Posts
    712
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by 7stud
    What if the user doesn't have javascript enabled?
    They are presented with a message using <noscript>

    Sorry... portfolio viewing requires a javascript enabled browser.

  8. #8
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may want to make gPicWin a global variable and then use setTimeout() to allow the popup to finish loading.
    The easier way to accomplish the same thing is to put an onload event in your popup which changes the title, but it doesn't work: in FF1.0, you always get the domain preceding the title you want.

  9. #9
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    NY, USA
    Posts
    712
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's weird because the way I do it now, FF handles it fine... it's IE that plops the domain in the title bar.

    At any rate, I'm not going to lose any sleep over this. It's so minor I'll just let it slide. I do appreciate your suggestions. Thank you


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
  •