Fix #1, replace the special characters in your Javascript codes
Here's a chart of the special characters need to be replaced in your JavaScript codes:
An explanation can be found from the Wikipedia reference here.
Example: You got a few lines of JavaScript codes from an AD company to display their banner ADs, inside the codes there are a few '&'.
Fix: Replace all the '&' with '&'
Fix #2, add the codes inside a CDATA section
In this fix, enclose your actual JavaScript codes between a pair of tags //<![CDATA[ and //]]>, like:
<script type="text/javascript">
//<![CDATA[
put the JavaScript scripts here
//]]>
</script>
That means, you have to add the pair of tags //<![CDATA[ and //]]> manually into your Javascript codes as showing in above, then paste all the codes into Blogger template or widget.
Here's a chart of the special characters need to be replaced in your JavaScript codes:
Special code | Replace with entity name |
---|---|
> | > |
< | < |
& | & |
" | " |
An explanation can be found from the Wikipedia reference here.
Example: You got a few lines of JavaScript codes from an AD company to display their banner ADs, inside the codes there are a few '&'.
Fix: Replace all the '&' with '&'
Fix #2, add the codes inside a CDATA section
In this fix, enclose your actual JavaScript codes between a pair of tags //<![CDATA[ and //]]>, like:
<script type="text/javascript">
//<![CDATA[
put the JavaScript scripts here
//]]>
</script>
That means, you have to add the pair of tags //<![CDATA[ and //]]> manually into your Javascript codes as showing in above, then paste all the codes into Blogger template or widget.
0 Komentar untuk "XML/JavaScript"