One of my company's page contains a line like this:
The page has worked well since day one. However, since last week, this page was suddenly broken on our development server only. The browser keeps complaining that there is runtime error "unterminated string constant". But it still works fine on both live server and QA server.
So I made a change like this:
then the error is gone.
I understand why the fix worked. But I don't not understand why it worked before and it still works on live and QA server w/o this fix.
Could someone kindly explain it to me? Many thanks!
Code:
function printTitle() {
parent.searchTermsPane.document.write("<script>function hideIt(aControl) {alert(aControl.name);}[b]</script>[/b][COLOR=blue]/* some implementations omitted here */[/color]");
}
The page has worked well since day one. However, since last week, this page was suddenly broken on our development server only. The browser keeps complaining that there is runtime error "unterminated string constant". But it still works fine on both live server and QA server.
So I made a change like this:
Code:
function printTitle() {
parent.searchTermsPane.document.write("<script>function hideIt(aControl) {alert(aControl.name);}[b]<[COLOR=red]\[/color]/script>[/b][COLOR=blue]/* some implementations omitted here */[/color]"); }
then the error is gone.
I understand why the fix worked. But I don't not understand why it worked before and it still works on live and QA server w/o this fix.
Could someone kindly explain it to me? Many thanks!