1 Link opening 2 pages in two iframes each on different seperate pages More options

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SHC

    1 Link opening 2 pages in two iframes each on different seperate pages More options

    I'm in need of some javascript to load two pages into two seperate
    iframes which are on two seperate and different pages.

    Rather complicated I know (and easier done in one frameset), but
    caused by some limitation issues of SharePoint.


    To help:


    Link is on thumbnails.htm
    iFrame1 is on intro.htm
    iFrame2 is on details.htm
    Page for iframe1 is cd_summary.htm
    Page for iframe2 is cd_content.htm


    Any help would be most gratefully appreciated.


    SHC

  • shimmyshack

    #2
    Re: 1 Link opening 2 pages in two iframes each on different seperate pages More options

    On 29 Mar, 13:50, "SHC" <stu...@hall-cooper.me.ukwro te:
    I'm in need of some javascript to load two pages into two seperate
    iframes which are on two seperate and different pages.
    >
    Rather complicated I know (and easier done in one frameset), but
    caused by some limitation issues of SharePoint.
    >
    To help:
    >
    Link is on thumbnails.htm
    iFrame1 is on intro.htm
    iFrame2 is on details.htm
    Page for iframe1 is cd_summary.htm
    Page for iframe2 is cd_content.htm
    >
    Any help would be most gratefully appreciated.
    >
    SHC
    do you mean

    <html><body>
    <iframe id="iframe1" src="intro.htm" ></iframe>
    <iframe id="iframe2" src="details.ht m"></iframe>
    </body></html>

    or that the three pages are open at once in three tabs, or windows.

    or that there a three frames in a framset (pages intro and details),
    that these two child frames have iframes within them which you need to
    change


    if the first then
    var if1 = document.getEle mentById('ifram e1');
    var if2 = document.getEle mentById('ifram e2');
    if1.src='cd_sum mary.htm';
    if2.src='cd_con tent.htm';
    should do it.

    Comment

    • shimmyshack

      #3
      Re: 1 Link opening 2 pages in two iframes each on different seperate pages More options

      On 29 Mar, 13:50, "SHC" <stu...@hall-cooper.me.ukwro te:
      I'm in need of some javascript to load two pages into two seperate
      iframes which are on two seperate and different pages.
      >
      Rather complicated I know (and easier done in one frameset), but
      caused by some limitation issues of SharePoint.
      >
      To help:
      >
      Link is on thumbnails.htm
      iFrame1 is on intro.htm
      iFrame2 is on details.htm
      Page for iframe1 is cd_summary.htm
      Page for iframe2 is cd_content.htm
      >
      Any help would be most gratefully appreciated.
      >
      SHC
      i suppose you could mean that you are on thumbnails.htm and you want
      to click on
      <a href="intro.htm ">intro</a>
      <a href="details.h tm">details</a>
      each of which have an iframe in them which you want to set to
      cd_summary.htm and cd_content.htm respectively.

      Comment

      • SHC

        #4
        Re: 1 Link opening 2 pages in two iframes each on different seperate pages More options

        On 29 Mar, 14:55, "shimmyshac k" <matt.fa...@gma il.comwrote:
        On 29 Mar, 13:50, "SHC" <stu...@hall-cooper.me.ukwro te:
        >
        >
        >
        >
        >
        I'm in need of some javascript to load two pages into two seperate
        iframes which are on two seperate and different pages.
        >
        Rather complicated I know (and easier done in one frameset), but
        caused by some limitation issues of SharePoint.
        >
        To help:
        >
        Link is on thumbnails.htm
        iFrame1 is on intro.htm
        iFrame2 is on details.htm
        Page for iframe1 is cd_summary.htm
        Page for iframe2 is cd_content.htm
        >
        Any help would be most gratefully appreciated.
        >
        SHC
        >
        i suppose you could mean that you are on thumbnails.htm and you want
        to click on
        <a href="intro.htm ">intro</a>
        <a href="details.h tm">details</a>
        each of which have an iframe in them which you want to set to
        cd_summary.htm and cd_content.htm respectively.- Hide quoted text -
        >
        - Show quoted text -
        An example of what I'm trying to do, is using the following structure,

        thumbnails.htm :
        <a target="iFrame1 " href="cd_summar y_001.htm"><img src="cd_001.gif "></
        a>
        <a target="iFrame1 " href="cd_summar y_002.htm"><img src="cd_002.gif "></
        a>

        intro.htm :
        <body><iframe width="635" height="628" name="iFrame1" id="iFrame1"
        frameborder="1" >Your browser does not support inline frames or is
        currently configured not to display inline frames.</iframe></body>

        details.htm :
        <body><iframe width="635" height="628" name="iFrame2" id="iFrame2"
        frameborder="1" >Your browser does not support inline frames or is
        currently configured not to display inline frames.</iframe></body>

        This structure works for changing the content in iFrame1 on intro.htm
        to the appropriate cd_summary htm page, but I need a way of changing
        iFrame 2 on details.htm at the same time to the appropriate cd_content
        page (i.e. cd_content_001. htm or cd_content_002. htm)

        Does this make things any clearer?
        SHC

        Comment

        • shimmyshack

          #5
          Re: 1 Link opening 2 pages in two iframes each on different seperate pages More options

          On 29 Mar, 15:23, "SHC" <stu...@hall-cooper.me.ukwro te:
          On 29 Mar, 14:55, "shimmyshac k" <matt.fa...@gma il.comwrote:
          >
          >
          >
          On 29 Mar, 13:50, "SHC" <stu...@hall-cooper.me.ukwro te:
          >
          I'm in need of some javascript to load two pages into two seperate
          iframes which are on two seperate and different pages.
          >
          Rather complicated I know (and easier done in one frameset), but
          caused by some limitation issues of SharePoint.
          >
          To help:
          >
          Link is on thumbnails.htm
          iFrame1 is on intro.htm
          iFrame2 is on details.htm
          Page for iframe1 is cd_summary.htm
          Page for iframe2 is cd_content.htm
          >
          Any help would be most gratefully appreciated.
          >
          SHC
          >
          i suppose you could mean that you are on thumbnails.htm and you want
          to click on
          <a href="intro.htm ">intro</a>
          <a href="details.h tm">details</a>
          each of which have an iframe in them which you want to set to
          cd_summary.htm and cd_content.htm respectively.- Hide quoted text -
          >
          - Show quoted text -
          >
          An example of what I'm trying to do, is using the following structure,
          >
          thumbnails.htm :
          <a target="iFrame1 " href="cd_summar y_001.htm"><img src="cd_001.gif "></
          a>
          <a target="iFrame1 " href="cd_summar y_002.htm"><img src="cd_002.gif "></
          a>
          >
          intro.htm :
          <body><iframe width="635" height="628" name="iFrame1" id="iFrame1"
          frameborder="1" >Your browser does not support inline frames or is
          currently configured not to display inline frames.</iframe></body>
          >
          details.htm :
          <body><iframe width="635" height="628" name="iFrame2" id="iFrame2"
          frameborder="1" >Your browser does not support inline frames or is
          currently configured not to display inline frames.</iframe></body>
          >
          This structure works for changing the content in iFrame1 on intro.htm
          to the appropriate cd_summary htm page, but I need a way of changing
          iFrame 2 on details.htm at the same time to the appropriate cd_content
          page (i.e. cd_content_001. htm or cd_content_002. htm)
          >
          Does this make things any clearer?
          SHC
          yeah sure, what you need to know though is that it won't be
          accessible, however from what Ive seen of sharepoint, - it isnt an
          accessible platform, so here we go


          there are a few ways, here are 2

          1) inside the summary.htm you have some javascript that is hard coded
          to load the parent.iframe2. src='cd_details _002.htm', so that when the
          summary iframe loads it loads the details iframe. (which would require
          that you hard code the details page into each summary page



          2) you create a function which takes the value of the link you click
          on and sets both iframes accordingly, we dont bother with the target
          attribute anymore

          <html>
          <head>
          <script type="text/javascript">
          //say you have just clicked cd_summary_002. htm
          //and your intro.htm for that cd is cd_summary_002. htm
          //and the details file is cd_details_002. htm
          function changeIframe2Sr c( cd_summary_url )
          {
          //loads cd_summary_002. htm into iframe1
          document.getEle mentById('ifram e1').src = cd_summary_url;
          //loads cd_details_002. htm into iframe2
          document.getEle mentById('ifram e2').src =
          cd_summary_url. replace('summar y','details');
          return false;
          }
          </script>
          </head>
          <body>
          <a href="cd_summar y_002.htm"
          onclick="change Iframe2Src(this .href);return false;"><img
          src="cd_002.gif "></a>
          <br />
          <iframe id="iframe1">if rame1</iframe>
          <iframe id="iframe2">if rame2</iframe>
          </body>
          </html>

          Comment

          • Randy Webb

            #6
            Re: 1 Link opening 2 pages in two iframes each on different seperatepages More options

            shimmyshack said the following on 3/29/2007 11:52 AM:

            <snip>
            //loads cd_summary_002. htm into iframe1
            document.getEle mentById('ifram e1').src = cd_summary_url;
            //loads cd_details_002. htm into iframe2
            document.getEle mentById('ifram e2').src =
            Did you test setting the src property of an IFrame? I bet you didn't.
            And, why are people steadily falling into the gEBI crutch when a better
            method exists?

            document.frames['iframe2'].location.href = somethingElse

            --
            Randy
            Chance Favors The Prepared Mind
            comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
            Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

            Comment

            • shimmyshack

              #7
              Re: 1 Link opening 2 pages in two iframes each on different seperate pages More options

              On 29 Mar, 17:29, Randy Webb <HikksNotAtH... @aol.comwrote:
              shimmyshack said the following on 3/29/2007 11:52 AM:
              >
              <snip>
              >
              //loads cd_summary_002. htm into iframe1
              document.getEle mentById('ifram e1').src = cd_summary_url;
              //loads cd_details_002. htm into iframe2
              document.getEle mentById('ifram e2').src =
              >
              Did you test setting the src property of an IFrame? I bet you didn't.
              And, why are people steadily falling into the gEBI crutch when a better
              method exists?
              >
              document.frames['iframe2'].location.href = somethingElse
              >
              --
              Randy
              Chance Favors The Prepared Mind
              comp.lang.javas cript FAQ -http://jibbering.com/faq/index.html
              Javascript Best Practices -http://www.JavascriptT oolbox.com/bestpractices/
              Hiya Randy,
              I did actually [only as in does it work], it's IE6/7, Op9 and FF2; but
              personally I wouldn't even go this way at all, it's a fudge to fix a
              cludge! I hate all things like this, iframes, onclicks etc.. prefering
              simple simple code with the fix as an include somewhere in the head.
              I do admit to using the gEBI alot more than perhaps I should, it can
              be useful to send to people whose code is "under developement" because
              no matter where they plonk the next thing, and change the order etc..
              the reference is unchanged, but I take your point.

              Comment

              • -Lost

                #8
                Re: 1 Link opening 2 pages in two iframes each on different seperate pages More options

                "Randy Webb" <HikksNotAtHome @aol.comwrote in message
                news:UaSdnRpbf4 nVdJbb4p2dnA@gi ganews.com...
                shimmyshack said the following on 3/29/2007 11:52 AM:
                >
                <snip>
                >
                >//loads cd_summary_002. htm into iframe1
                > document.getEle mentById('ifram e1').src = cd_summary_url;
                >//loads cd_details_002. htm into iframe2
                > document.getEle mentById('ifram e2').src =
                >
                Did you test setting the src property of an IFrame? I bet you didn't. And, why are
                people steadily falling into the gEBI crutch when a better method exists?
                >
                document.frames['iframe2'].location.href = somethingElse
                Shouldn't that be:

                window.frames['iframe2'].location.href = somethingElse; // ...?

                -Lost


                Comment

                Working...