Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder thesmart1's Avatar
    Join Date
    Dec 2005
    Posts
    369
    Thanks
    7
    Thanked 3 Times in 3 Posts

    Detect page title across frames

    I have a frameset with several frames, including one called page. Is there a way to detect the title of whatever site is loaded in the page frame and use that as the title of the browser window?

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    yes it can be done. if you are using frames then i am sure you are familiar with naming frames, and that the browser window is the parent.

    so do as such:

    detect an inner frames title:

    var tit=parent.yourframesname.document.title;

    then assign that value to the parent window's title:

    parent.document.title=tit;


    its that simple.
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Just be aware the above won't work on sites not on your own domain. Seeing as how you plan on using a local page on your system (which I think is pointless because this is exactly what a browser does) you won't be able to get the titles of other sites not on your system.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    not totally true Aero. it is possible, just gatta know how to do it. i currently have a plain html file on my local hardrive that accesses any site i want it to and grabs the entire content of said site. of course it prompts the user that the script is trying to access something not under its control, but if the user clicks allow, it still does it, and if you just change the .html to .hta it now runs as a hyper text appliocation, which has granted higher security rights. so running as an .hta file the user wont get prompted about cross domain issues. of course .hta is a microsoft internet explorere thing only, so it wont work for all browsers or operating systems.
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Hmm but what about a browser like Firefox? Could you get it allow access to non local sites? I know about the hta stuff and the warnings that will popup.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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