By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,261 Members | 1,658 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,261 IT Pros & Developers. It's quick & easy.

Unicode + Escape Character = IE Unterminated string constant error!

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.