Write a dynamic iframe |
Write a dynamic iframe |
RainLover |
Nov 11 2011, 01:48 PM
Post
#1
|
Advanced Member Group: Members Posts: 216 Joined: 16-November 09 Member No.: 10,346 |
Hi,
I wonder if the following is coded correctly: CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Sample Page</title> </head> <body> <div id="container"></div> <script type="text/javascript"> var url = "http://www.example.com/"; var content = "<iframe width='800' height='600' frameborder='0' src='" + url + "'><\/iframe>"; document.getElementById("container").innerHTML = content; </script> </body> </html> Many thanks in advance! Mike |
Christian J |
Nov 11 2011, 03:03 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
Seems correct, but of course it will only work if inline frames and javascript are enabled/supported. At least some search engine's (Google) claim to be able to find the framed page's URL in the script as well, in which case they might link directly to the orphaned page.
|
Lo-Fi Version | Time is now: 19th April 2024 - 04:26 PM |