My apologies for not explaining the thread closure earlier.
I closed the thread due to the aggressive nature of the last post, not due
to the topic of javascript. My concern was that the post could have lead to
a possible flame war and this is definitely something we do not want to see
on this lis
**
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
**
On 4/14/05 2:51 AM "Juergen Auer" <[EMAIL PROTECTED]> sent this out:
>> var msg="Don't Look Now";
>>
>> Don't Look Now
>
> This works. But what to do if the message also needs " inside?
Can we keep the javascript cr*p off this list? Thanks!
Rick Faaberg
***
On 14 Apr 2005 at 15:35, Bruce Morrison wrote:
> var msg="Don't Look Now";
>
> Don't Look Now
This works. But what to do if the message also needs " inside?
Make it generic:
var msg="Don" + String.fromCharCode(39) + " use " +
String.fromCharCode(34) + "too" +
String.fromCharCode(34) + " much
var msg="Don't Look Now";
Don't Look Now
Very smart Bruce. The other method's more compact, but that's some
good lateral thinking.
"Have You Validated Your Code?"
John Horner(+612 / 02) 9333 3
You have 3 options:
1. use ’ instead of '
2. call you function as myfunction('Don\'t Look Now')
3. myfunction(unescape('Don%27t Look Now'))
Thanks so much Dmitry, I've actually used a combination of the above.
myfunction(escape('Don’t Look Now'))
and then unescaped it at the "other end"... I c
On Thu, 2005-04-14 at 15:17, John Horner wrote:
> Following up on my own post, but I neglected to say, the apostrophe
> could be escaped, just for JavaScript purposes, like this:
>
> 'Don\'t Look Now'
>
> but this text is coming out of a CMS, and the same string needs to be
> used both on
> but this text is coming out of a CMS, and the same string needs to be
> used both on the page and in the JavaScript.
In this case put body of the function into inline script block - not a
attribute value and use double quotes.
Or another super hack is to put this text into hidden span under the
Following up on my own post, but I neglected to say, the apostrophe
could be escaped, just for JavaScript purposes, like this:
'Don\'t Look Now'
but this text is coming out of a CMS, and the same string needs to be
used both on the page and in the JavaScript.
---
You have 3 options:
1. use ’ instead of '
2. call you function as myfunction('Don\'t Look Now')
3. myfunction(unescape('Don%27t Look Now'))
On 4/14/05, John Horner <[EMAIL PROTECTED]> wrote:
> [Maybe a little off-topic but I thought you'd be likely to know]
>
> I have page titles which sometimes
[Maybe a little off-topic but I thought you'd be likely to know]
I have page titles which sometimes require single quotes, i.e. "Don't Look Now"
The titles also need to appear in a javascript onClick function like this:
as you can guess, that breaks the JavaScript because of the quote in "Don
11 matches
Mail list logo