• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 904
  • Last Modified:

Suppress Unterminated String Constant Error Message in IE

I am getting the "Unterminated String Constant" JavaScript error message on my webpage. The error only occurs in IE8. I do not get it in Chrome or Firefox. Can this message be suppressed using JavaScript code on my page. I am not sure what is causing it.
0
msjlogicjunction
Asked:
msjlogicjunction
  • 2
  • 2
1 Solution
 
GeoffHarperCommented:
I don't think you can pick and choose JavaScript errors.

Post your code, we'll fix it.
0
 
Greg AlexanderLead DeveloperCommented:
Something like the attahced
<script>
function handleError(){
  return true;
}
window.onerror = handleError;
</script>

Open in new window

0
 
GeoffHarperCommented:
I meant to attach the offending code.  The best way to stop error messages is to fix the code that's causing it - not to suppress the errors;  that's a little like taking morphine to fix a broken leg so you can keep running.
0
 
khan_webguruCommented:
If you are using any this like this

functionX('<?=$buffer?>');

not exactly like this means if you are getting any of the response from server or JSON string then on that variable just perform following action

 
$buffer = str_replace(Chr(13), "", $buffer);

Open in new window


If not Chr(13), check for the correspondent code...it can be End Of Line, Carriage Return, etc...and then, you pass it to the javascript.

That should remove all "enters" off your code, as to leave it in a single line!!

Good Luck, let me know how it worked..

hope this will give you some idea.

source of info: http://forums.devarticles.com/javascript-development-22/unterminated-string-constant-error-in-javascript-11835.html

Regards,

AAK
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now