iframe attribute question need answered

2 replies
  • WEB DESIGN
  • |
How does one get links when clicked on in the iframe to not go to the page in the iframe, but use the page that the iframs is inside of?

Another way to put it; you have Page A. Page A has an iframe. When a link inside the iframe is clicked, i want Page A to show that page ... and not load in the iframe.

Help is appreciated!
#answered #attribute #iframe #question
  • Profile picture of the author johnnyN
    there are scripts for that

    go to this page iFrame HTML | iFrame html, tricks, tips and code
    {{ DiscussionBoard.errors[4574037].message }}
  • Profile picture of the author YongC
    Here is your code save it with html type and see the result :

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <title>Hello ^^</title>
    <script>
    function change_ifram(linksite)
    {
        $("#myiframe").attr('src',linksite);
    }
    </script>
    
    </head>
    
    <body>
    <center>
    <a href="javascript:;" onclick="change_ifram('http://google.com')">GOOGLE</a><br/>
    <a href="javascript:;" onclick="change_ifram('http://youtube.com')">YOUTUBE</a><br/>
    <a href="javascript:;" onclick="change_ifram('http://zaaho.com')">ZAAHO</a><br/>
    </center>
    <br/>
    <CENTER><iframe id="myiframe" src="http://www.warriorforum.com" width="500" height="300"></iframe></CENTER>
    
    </body>
    </html>
    
    {{ DiscussionBoard.errors[4574654].message }}

Trending Topics