PDA

View Full Version : Unterminated String constant javascript error



sankari81
04-12-2010, 06:59 AM
Hi

I am getting Unterminated String constant javascript error error not because of uncompleted string. Because of some invalid characters.

Ex: asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretrasdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretrasdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfsdfsdfwerwerw werwerererwerwerweeretretr
asdfs fsdfs fsdfsdfsd dsfsdfsa sfsd sdfsdfsdfss.



This string i copied into text area and pressing submit that time getting this type of error.
I am checking for a special character like

value = value.replaceAll("&", "&amp;").replaceAll("'", "&#39;").replaceAll("\"", "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");

//Special Characters
value = value.replaceAll("Š", "%u0160").replaceAll("š", "%u0161").replaceAll("Ž", "%u017D").replaceAll("˜", "%u02DC");

But no use.
any one ca give a solution please?