Results 1 to 3 of 3

Thread: IFrame SSI script II works with http://intranet/ but not http://intranet.domain.com/

  1. #1
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default IFrame SSI script II works with http://intranet/ but not http://intranet.domain.com/

    IFrame SSI script II
    http://www.dynamicdrive.com/dynamici...iframessi2.htm

    This script is brilliant. I've incorporated it into my company's intranet site for a project involving a photo directory. I thought it was working fine until today, when one of the managers tested it out and found a problem (talk about embarrassing). The page with the script works fine when you go to http://intranet/section/page.html but breaks when you go to http://intranet.domain.com/section/page.html. I'm not sure why that would really make any difference at all. The intranet is hosted internally and both of those addresses take you to the same page(s). I've tried changing the script from being embedded directly on the page to being a separate file with a relative link pointing to it, but besides that I have no clue what to do about this one. Any help would be greatly appreciated.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,902
    Thanks
    3
    Thanked 967 Times in 955 Posts
    Blog Entries
    15

    Default

    Sub domains, or ones with the syntax subdomain.mysite.com is treated as a separate domain from mysite.com/subdomain/ as far as JavaScript is concerned. Due to this, the IFRAME SSI script will only work in one of the two, but not both unfortunately.
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    Levi4884 (09-09-2008)

  4. #3
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick reply. For anyone referring to this post in the future, I found a quick and easy solution. In the header tags of each HTML page I inserted a little bit of Javascript that looks at the current URL and changes it to the full URL if needed:

    var currentURL = '' + window.location;

    if (currentURL.match('http://intranet/dir/page.htm')){
    window.location = 'http://intranet.domain.com/dir/page.htm';
    }


    Quick, easy, and it works!

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
  •