[thelist] passing HTML into a js text array
Jeff
jeff at members.evolt.org
Tue, 21 Dec 1999 21:14:32 -0800
matt,
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Matthew Haughey <haughey@ssc.ucla.edu>
:
: For a fun, I was playing with a dhtml text zoom thing I downloaded here:
:
: http://www.jsworld.com/dhtml/how-to/style/zoomtext.html
:
: It works by growing text strings in an array, using javascript and css.
:
: I haven't had any problems passing text into the array, except when there
: are links inside the text strings (even after I've escaped out all the
: single quotes and double slashes).
:
: if zoom the following text: <a href=\"http:\/\/yahoo.com\">Yahoo.com</a>
is
: great
:
: it shows up as plain text (with the "<" and ">" symbols and everything,
: instead of the word Yahoo.com being linked.
:
: any ideas on how to pass HTML to a javascript text array?
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
has absolutely nothing to do with javascript text array. it has to do with
the DOM reference used to put the text in the div. i assume you only tested
it in ie4/5 and didn't get around to trying it in nn4.
line #117 in the source of the URL you mention above contains the problem.
zoomText='document.all.zoom.innerText=text[num]'
notice that it's referencing innerText, this automatically eliminates html
from the equation, rendering everything as you see it. instead you'll have
to use innerHTML.
zoomText='document.all.zoom.innerHTML=text[num]'
it took me a bit to find it, but with that simple change it works just
peachy.
good luck,
: jeff.howden
: web.development.professional
: evolt.org.member
:
: the.best.looking.developers.on.the.net
:
: http://evolt.org/
: jeff@members.evolt.org