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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don't think you can pick and choose JavaScript errors.

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

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
If you are using any this like this


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 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:


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.