Re: block writing



On Feb 28, 1:41 pm, Jim <j_gree...@xxxxxxxxx> wrote:
Does this not work?

var element = document.getElementById("divTFooter");
element.appendChild(document.createTextNode('this is an example of a
link: <a href="test.html">link</a>'));

note the use of SINGLE quotes (')

Jim

Jim, it would work except if there is javascript in any of the xhtml,
then I am back to square one. I thought I had come across a way to do
it once, and apparently didn't write it down or store an example. The
reason I am trying to do this is because I have several pages that
have the same text/code and I would like to have javascript populate
those areas so a single change to the javascript will be a global
change. Using several document.writes gets messy so I was looking for
a better way.

Dave
.



Relevant Pages

  • Re: Javascript escape & JScript GlobalObject.escape
    ... escape is a url escape and single quotes are legal in urls, ... if your are outputing a javascript literal, ... javascript quoting. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: popup page in aspx
    ... Well, for one thing, it doesn't look like valid javascript. ... you need quotes or single quotes around test.htm. ... Are you sure you aren't getting a javascript error, ... > private sub ButtonAdd_Click(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: htmlentities()
    ... you want the double quotes as entities, converting the single quotes ... will usually end up destroying the javascript in there. ...
    (comp.lang.php)
  • Re: htmlentities()
    ... most people use double quotes for their tag attributes rather then single quotes. ... In most circumstances, you don't want both (for instance, setting an onclick attribute on a tag in double quotes: you want the double quotes as entities, converting the single quotes will usually end up destroying the javascript in there. ... Rik Wasmus ...
    (comp.lang.php)
  • Re: javascript passing by reference problem
    ... > i am a oo programmer, ... > out how javascript manages its references. ... Javascript leaves the mechanism of references to objects up to the ... Yikes, an XHTML doctype. ...
    (comp.lang.javascript)