469,626 Members | 979 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

Unicode + Escape Character = IE Unterminated string constant error!

Let's say I have a string:

div.innerHTML = "<a onclick='foo(\""+myWord+"\");'></a>";

in IE only (tested version 7) if var myWord = "English" then it works
fine
but if var myWord = "Modifier Cha\u00EEnes" then I get "Unterminated
string constant" error.

What fix would you suggest to keep div.innerHTML = "" format?
Thanks.

Nov 1 '07 #1
1 5755
On Nov 1, 12:23 pm, VUNETdotUS <vunet...@gmail.comwrote:
Let's say I have a string:

div.innerHTML = "<a onclick='foo(\""+myWord+"\");'></a>";

in IE only (tested version 7) if var myWord = "English" then it works
fine
but if var myWord = "Modifier Cha\u00EEnes" then I get "Unterminated
string constant" error.

What fix would you suggest to keep div.innerHTML = "" format?
Thanks.
works well using escape() function. is it the best choice?..

Nov 1 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by B Dring | last post: by
reply views Thread by George Durzi | last post: by
2 posts views Thread by polilop | last post: by
15 posts views Thread by wizardyhnr | last post: by
7 posts views Thread by 7stud | last post: by
1 post views Thread by Eric S. Johansson | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.