Announcement

Collapse
No announcement yet.

placement of code for targets

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • placement of code for targets

    I received a positive response for how to target more than one frame. I was told to use either:

    <a href="java_script_:void(0);" onclick="document.frame1.location.href='HTTP://WWW.URL1.COM';document.frame2.location.href='HTTP://WWW.URL2.COM'">parent link</a>

    <a href="java_script_:;" onclick="document.frame1.location.href='HTTP://WWW.URL1.COM';document.frame2.location.href='HTTP://WWW.URL2.COM'">parent link</a>

    But i am not using links. I am using an image map. My question:
    here is my code for an item in the image map. How would i insert the above in the below or do i have to use links? thanks in advance
    <area shape="rect" coords="189,17,280,32" href="resume.html" target="mainFrame">

  • #2
    Originally posted by annecs
    I received a positive response for how to target more than one frame. I was told to use either:

    <a href="java_script_:void(0);" onclick="document.frame1.location.href='HTTP://WWW.URL1.COM';document.frame2.location.href='HTTP://WWW.URL2.COM'">parent link</a>

    <a href="java_script_:;" onclick="document.frame1.location.href='HTTP://WWW.URL1.COM';document.frame2.location.href='HTTP://WWW.URL2.COM'">parent link</a>

    But i am not using links. I am using an image map. My question:
    here is my code for an item in the image map. How would i insert the above in the below or do i have to use links? thanks in advance
    <area shape="rect" coords="189,17,280,32" href="resume.html" target="mainFrame">
    Hi Anne

    I have just replied to the other thread but, if this is for xhtml, you should be aware that the target attribute will not be valid when declared on the element. If you need to use it then add it to the onclick event-handler:

    <a href="javascript:void(0);" onclick="document.yourframenamehere.location.href='HTTP://WWW.URL1.COM';document.yourframenamehere.location.href='HTTP://WWW.URL2.COM';this.target='mainframe'">parent link</a>
    Later
    Keith

    Webxpertz Community for Webmasters & Developers

    Comment


    • #3
      the continued link question

      Hi Diades
      I am not using xhtml. I am using html. Hopefully this is alright?
      your response is greatly appreciated but again15{ext link and i need to use the multiple linking w/an image map:
      <area shape="rect" coords="189,17,280,32" href="resume.html" target="mainFrame">

      can I somehow have my one click change two frames?
      thanks!
      anne



      Originally posted by diades
      Hi Anne

      I have just replied to the other thread but, if this is for xhtml, you should be aware that the target attribute will not be valid when declared on the element. If you need to use it then add it to the onclick event-handler:

      <a href="javascript:void(0);" onclick="document.yourframenamehere.location.href='HTTP://WWW.URL1.COM';document.yourframenamehere.location.href='HTTP://WWW.URL2.COM';this.target='mainframe'">parent link</a>

      Comment


      • #4
        Hi Anne

        Just checking about the xhtml, you may have been as the latest version of Vbulletin uses it and it may have had something to do with that. If you aere using html, no problem.

        <area shape="rect" coords="189,17,280,32" href="resume.html" target="mainFrame">

        <a href="javascript:void(0);" onclick="document.yourframenamehere.location.href='HTTP://WWW.URL1.COM';document.yourframenamehere.location.href='HTTP://WWW.URL2.COM';this.target='mainframe'">parent link</a>

        Just blending the two above should do it:

        <area shape="rect" coords="189,17,280,32" href="javascript:void(0);" onclick="document.mainframe.location.href='resume.html';location.href='HTTP://WWW.URL2.COM';">

        change the url of the part in red for the second url
        Later
        Keith

        Webxpertz Community for Webmasters & Developers

        Comment


        • #5
          stilling looking....

          Originally posted by diades
          Hi Anne

          Just checking about the xhtml, you may have been as the latest version of Vbulletin uses it and it may have had something to do with that. If you aere using html, no problem.

          <area shape="rect" coords="189,17,280,32" href="resume.html" target="mainFrame">

          <a href="javascript:void(0);" onclick="document.yourframenamehere.location.href='HTTP://WWW.URL1.COM';document.yourframenamehere.location.href='HTTP://WWW.URL2.COM';this.target='mainframe'">parent link</a>

          Just blending the two above should do it:



          <area shape="rect" coords="189,17,280,32" href="javascript:void(0);" onclick="document.mainframe.location.href='resume.html';location.href='HTTP://WWW.URL2.COM';">

          change the url of the part in red for the second url

          nope, nothing happens....have you tried this successfully? i can't imagine how it would know to go to different frames...what is location.href? should it be document.nav.location? i tried that originally with no succes...thanks though. anne

          Comment


          • #6
            Originally posted by annecs
            nope, nothing happens....have you tried this successfully? i can't imagine how it would know to go to different frames...what is location.href? should it be document.nav.location? i tried that originally with no succes...thanks though. anne
            The location object contains all data regarding the url for the current page location.href gives the current url for the window and can be changed by stating (location.href = "myfile.htm") to change the url of a different window you use the location object of that window so:
            top.mainframe.location href - presuming that the name of the other frame is called mainframe
            Later
            Keith

            Webxpertz Community for Webmasters & Developers

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X