[TYPO3-german] Javascript in Content-Elementen oder als Ausgabe eines Plugins

h p regnans at gmail.com
Mon Apr 14 14:53:33 CEST 2008


Hallo Liste,

Typo3 macht mir ein ernsthaftes Problem, JavaScript anzuzeigen. Wenn ich 
folgendes JavaScript in ein HTML-Contentelement eingebe:

<script type='text/javascript'><!--//<![CDATA[
   var m3_u =
(location.protocol=='https:'?'https://www.xxx.de/openads/www/delivery/ajs.php':'http://www.xxx.de/openads/www/delivery/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=52");
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" +
document.MAX_used);
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" +
escape(document.referrer));
   if (document.context) document.write ("&context=" +
escape(document.context));
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");
//]]>--></script>

kommt das dabei im Frontend heraus:

<script type="text/javascript"><!--//<![CDATA[
   var m3_u = 
(location.protocol=='https:'?'https://www.xxx.de/openads/www/delivery/ajs.php':'http://www.xxx.de/openads/www/delivery/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type="text/javascript" src="&quot;+m3_u);
   document.write (&quot;?zoneid=52&quot;);
   document.write (" ampcb=" + m3_r);
   if (document.MAX_used != " documentwriteampexcludedocumentmax_useddocumentwriteamplocescapewindowlocationifdocumentreferrerdocumentwriteamprefererescapedocumentreferrerifdocumentcontextdocumentwritecontextescapedocumentcontextifdocumentmmm_fodocumentwriteampmmm_fo1documentwrite=""><\/scr"+"ipt>");
//]]>--></script>

Es scheint, als wuerde der Text vor der Ausgabe nochmals geparst und der 
Parser bei Anfuehrungszeichen durcheinander kommen.

Kann man das irgendwie abstellen? Insbesondere brauche ich JavaScript 
als Ausgabe eines von mir geschriebenen Plugins. Kann man da 
sicherstellen, dass die Ausgabe nicht vermurkst wird? Oder wie gebt Ihr 
Javascript aus?

Gruss,

Helge


More information about the TYPO3-german mailing list