如何在TypoScript TYPO3代码中插入JavaScript管道

Adr*_*ian 1 javascript typo3 typoscript

是否可以将管道|(从JavaScript代码)插入TypoScript?当我插入该代码时:

page.jsFooterInline {
 10 = TEXT
 10.dataWrap (
<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

 )
}
Run Code Online (Sandbox Code Playgroud)

TYPO3将管道元素视为wrap并切断管道后面的所有代码.

谢谢你的帮助

Wip*_*ter 8

你可以这样在typoscript模板中插入内联javascript:

page.jsFooterInline {

  10 = TEXT
  10.value (
       var _gaq = _gaq || [];
  )
}
Run Code Online (Sandbox Code Playgroud)