rimmer333
1/19/2012 - 1:37 PM

index.htm


<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title> - jsFiddle demo</title>
  
  <script type='text/javascript' src='/js/lib/mootools-core-1.4.2-full-nocompat.js'></script>
  
  <link rel="stylesheet" type="text/css" href="/css/normalize.css">
  <link rel="stylesheet" type="text/css" href="/css/result-light.css">
  
  <style type='text/css'>
    #target {
    visibility: hidden;
    
}
  </style>
  


<script type='text/javascript'>//<![CDATA[ 
window.addEvent('load', function() {
var $, typ;

document.cookie = "test=This cookie came from the outer source";

$ = function(id) {
  return document.getElementById(id);
};

typ = $('thankyou');

typ.addEventListener('click', function() {
  var affcode, child, target, _i, _len, _ref;
  affcode = $('affcode');
  target = $('target').contentWindow.document;
  target.write(affcode.value);
  return false;
});
});//]]>  

</script>


</head>
<body>
  <p><legend>Your affiliate code:<br>
    <textarea id="affcode" rows=10 cols="40">
<script>alert("hi");
document.write('<hr>');
alert(document.cookie)
</script>    </textarea></legend></p>

<a href="#" id="thankyou">Click here to "reach" the "Thank you…" page</a>.

<iframe id="target"></iframe>
  
</body>


</html>