From: Stefan Weiss on 7 May 2010 21:27 On 08/05/10 02:24, M.L. wrote: > Thanks for the additional clues, but I'm just not getting something > right, even after quoting the argument. > > '<p onClick="makeTextarea('+counter+',\"'+ptext2+'\")">' > > Firefox Error Console: syntax error > makeTextarea(0, The onclick attribute is delimited by double quotes, so you can't use those inside the attribute value. It will come out as onClick="makeTextarea(0, "test_text")" The second " ends the attribute value. Try this: '<p onClick="makeTextarea(' + counter + ",'" + ptext2 + '\')">' -- stefan
From: M.L. on 8 May 2010 04:40 >> Thanks for the additional clues, but I'm just not getting something >> right, even after quoting the argument. >> >> '<p onClick="makeTextarea('+counter+',\"'+ptext2+'\")">' >> >> Firefox Error Console: syntax error >> makeTextarea(0, > >The onclick attribute is delimited by double quotes, so you can't use >those inside the attribute value. It will come out as > > onClick="makeTextarea(0, "test_text")" > >The second " ends the attribute value. Try this: > > '<p onClick="makeTextarea(' + counter + ",'" + ptext2 + '\')">' Thanks for your patience Stefan. To help me better understand the quoting mix I replaced each escaped quote with its HTML entity character ". It worked! '<p onClick="makeTextarea('+counter+',"'+ptext+'")">'
First
|
Prev
|
Pages: 1 2 Prev: FAQ Topic - How do I get the value of a form control? (2010-04-08) Next: Cujo 1.4 review |