Hi folks, I came across an intresting peice of script that redirects to links in a new browser with a custom table at the top. It appears to be automatic when somebody types in a link address.
I think there is some scripting hidden/missing that makes it work.
Im wondering if this can be made to work entirely client side with javascript, if so can somebody help me out?

<html> <head> <title>Leaving Reptile Planet...</title> <style type="text/css"> html { overflow: hidden; } body  { margin: 0; padding: 0; color: #000000; } a { color:#2A5D34; } table { border-collapse: collapse; margin: 0; width: 100%;border-bottom: 2px #2A5D34 solid; font: 12px arial, verdana, geneva, lucida, 'lucida grande', helvetica, sans-serif; } td { padding: 5px 10px; } #title { font-weight: bold; } #link { text-align: right; } .smallfont { display: none; }</style> </head> <body id="framePage" onload="resizeIframe('idTopFrame')"> <table BACKGROUND="http://i14.photobucket.com/albums/a345/Instar/escher_background.gif"> <tr> <td id="title"><a href="http://www.reptileplanet.net.tc">Reptile Planet</a></td> <td id="link">You have been redirected to <a href="http://www.google.com.au/">http://www.google.com.au/</a></td> </tr> </table> <iframe name="idTopFrame" id="idTopFrame" src="http://www.google.com.au/" frameborder="0" height="97%" width="100%"></iframe> </body> </html>

test here
http://www.jmarshall.com/easy/html/testbed.html

How about spreadiong it out into nice formatted code so we can read it?

Thats how this code was displayed on this site, not my doing. Whats shown is very clear to read.
Its whats not there (detecting external links then doing) thats what Im intrested in!

<html>
<head>
<title>Leaving Reptile Planet...</title>
<style type="text/css">
html {overflow: hidden;}
body {margin: 0; padding: 0; color: #000000;}
a      {color:#2A5D34;}

table {border-collapse: collapse; margin: 0; width: 100%; border-bottom: 2px #2A5D34 solid; font: 12px arial, verdana, geneva, lucida, 'lucida grande', helvetica, sans-serif;}

td {padding: 5px 10px;}
#title {font-weight: bold;}
#link {text-align: right;}
.smallfont {display: none;}
</style>
</head>
<body id="framePage" onload="resizeIframe('idTopFrame')">
<table BACKGROUND="http://i14.photobucket.com/albums/a345/Instar/escher_background.gif"> <tr>
  <td id="title">
    <a href="http://www.reptileplanet.net.tc">Reptile Planet</a>
  </td>
  <td id="link">You have been redirected to
    <a ref="http://www.google.com.au/">
      http://www.google.com.au/
    </a>
  </td>
</tr>
</table>
<iframe name="idTopFrame" id="idTopFrame" src="http://www.google.com.au/" frameborder="0" height="97%" width="100%">
</iframe>
</body>
</html>

It's a lot easier to decipher this way.

It looks like straight html to me. But there is some JavaScript and another page in the iframe.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.