In the current project I am working on we are using localization to allow translation into other languages. For more on localization check out this wiki entry
Much to my horror I found out yesterday that <script> tags are translated – as if it was just text on the screen.
<script> alert('hi Marky') </script>
when localization is turned on for French looks like this
<script> [fr| alert('hi Marky')] </script>
and funnily enough that causes problems in your code.
The reason it does this is because by default localization translates any text on the page and creates the appropriate properties file tage for it in the database – this is very cool when you want it to be, and apparently very annoying when you don’t. Localization clearly does not see any difference between <script> and <div> on the page for this purpose.
To correct this issue. you need use the computed output script instead.
<xp:scriptBlock id="scriptBlock1"> <xp:this.value><![CDATA[ alert('hi Marky') ]]> </xp:this.value> </xp:scriptBlock>