Part 1: Problem: This line does not print the image link.
Part 2: This line does print the image link.
Both parts generate the same source code, although the first one does not print the image link. Why?
(However the source code for the first part seems correct when I highlight div-section and click 'View Selection Source', but not if I click outside the div and choose 'View source'. why?)
/Thanks!
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
var destination="textDestination";
function showText(){
if (document.getElementById){
var dest=document.getElementById(destination);
if (dest){ // && dest.innerHTML)
//Part 1: Problem: This line does not print the image link.
dest.innerHTML = '<script type="text/javascript">document.write(\'<a href="http://www.google.com" target="_BLANK"><img src="http://t2.gstatic.com/images?q=tbn:ANd9GcQV7hsgG998z8l7T5pyok6xqJFVqFmXlMAKmBFZQ0n06eLOEtojQQE1qwGjYQ" border=5></a>\');</script>';
<!-- Part 2: This line does print the image link.
<script type="text/javascript">document.write('<a href="http://www.google.com" target="_BLANK"><img src="http://t2.gstatic.com/images?q=tbn:ANd9GcQV7hsgG998z8l7T5pyok6xqJFVqFmXlMAKmBFZQ0n06eLOEtojQQE1qwGjYQ" border=5></a>');</script>
-->
you have to loops through the tags and either add them if the have a .src, or eval thier (s.text||s.textContent||s.innerText||s.innerHTML) if they don't...
Bookmarks