Re: block writing



hendedav@xxxxxxxxx writes:

Joost,
I tried, as you suggested, and it didn't work as I thought. The
below is the code:

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

and I got a "missing ) after argument list" error after the quote
right before the test.html name. I will need to find something that
doesn't have quotes as the delimiters. Thanks though, any other
ideas?

Oh right. You mean you have to escape the quotes inside a quoted
string. There's no way around that if you use string literals.

It's annoying, of course, but I don't really see that there is a
problem. You generally don't put large sections of text in string
literals, and if you really want to you can easily write a short script
that generates the string literal for you:

$ perl -e '$_=join("",<>);s/\n/\\n/g;s/"/\\"/g;print qq("$_")' my.html



--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
.



Relevant Pages

  • RE: Double quotes in select statement throw an error
    ... quotes for all string literals and that these other drivers/servers handled ... non-standard syntax and it works. ... Use a valid query: ...
    (perl.dbi.users)
  • Re: Question about quoting style.
    ... In the world of shell scripting, I use a technique that I call minimal quoting. ... qaz="$baz $foo and grill" # Interpolation needs double quotes. ... is in Python, quoting style makes no difference wrt escape sequences. ... Third point is that quoting is not optional when it comes to string literals - but I guess you knew this one already!-) ...
    (comp.lang.python)
  • Re: VHDL style and possible problems for first time user
    ... In addition to what Colin wrote, bit string literals ... are enclosed in double quotes, ... Array indices are enclosed in parenthesis, ... -- full adder ...
    (comp.lang.vhdl)
  • Re: Embedding a newline in a vb.net string constant
    ... to use quotes, and then you need to embed other calls that also use ... This is real issue where the procedure compiler won't let you ... support "continued" string literals. ... M S Herfried K. Wagner ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Need help in understanding c code
    ... I64Fd is not in double quotes. ... the entire expression consists of three string ... When string literals abut or are separated only by white ...
    (comp.lang.c)