View Single Post
Old 07-03-2009, 02:05 PM  
Si
Such Fun!
 
Industry Role:
Join Date: Feb 2008
Posts: 13,900
Quote:
Originally Posted by SmokeyTheBear View Post
heres a rather dirty way of doing it

Code:
<html>
<body>
<iframe id=adframe src="#" width=600 height=200></iframe>
<button onclick=adframe.document.getElementById('stuff').innerHTML=s1>Change html 1</button><br>
<button onclick=adframe.document.getElementById('stuff').innerHTML=s2>Change html 2</button><br>

<script type="text/javascript">
var s1 = "<a href=https://gfy.com>gfy</a>";
var s2 = "<a href=http://ytmnd.webspacemania.com/htyt/>htyt</a>";
adframe.document.write("<div id=stuff></div>");
</script>
</body>
</html>
what you are doing is basically setting a blank iframe , adding a div called stuff to it, then injecting the html with script
That seems a bit long winded. but I'll remember that for the future. might come in handy elsewhere
Si is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote