since you have the string you can prepend to it: <script language="JavaScript" type="text/javascript"> <!-- function stoperror(){return true} window.onerror=stoperror // --> </script> This will suppress the javascript errors, if that is what is causing the problem.