Results 1 to 2 of 2

Thread: Iframes with url

  1. #1
    Join Date
    Aug 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Iframes with url

    Hi,
    I have a problem with iframes,

    I want to include page from different url in iframe,

    i did it so far but it redirect idirectly to main url, how can i stop in iframe only....

    my code is

    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" />
        <title>KI Windows Films - Car Tinter</title> 
    	</head>
    <body onload=top.location.replace(location.href)>
    <center>
    <div>
    	<iframe src="http://www.johnsonwindowfilms.com/car_tinter/tinter.php" id="i" name="i" width="700px" height="500px" align="middle"></iframe>
     </div>
    </center>
    </body> 
    </html>
    
    :)

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,030
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    If you view the source code of their page you'll see that they have this break-out-of-frames script:

    Code:
    <script language="JavaScript" type="text/javascript">
    <!--
    function breakout_of_frame()
    {
      // see http://www.thesitewizard.com/archive/framebreak.shtml
      // for an explanation of this script and how to use it on your
      // own website
      if (top.location != location) {
        top.location.href = document.location.href ;
      }
    }
    -->
    </script>
    Which means it stops that page from being contained in another website's Iframe, like yours - Sorry!

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
  •