[TYPO3-mvc] Fluid objects inside javascript doesn't work

Fernando Arconada falcifer2001 at yahoo.es
Sun Nov 14 20:02:42 CET 2010


El Sun, 14 Nov 2010 12:19:51 +0100, Bastian Waidelich escribió:

> Fernando Arconada wrote:
> 
> Hi Fernando,
> 
Thanks it works

but an alternative (and interchangeable) syntax like ##map.id## will lead 
to a cleaner code

Kind Regards

Fernando Arconada


> The Fluid TemplateParser probably gets confused by the curly brackets in
> the JavaScript code.
> Make sure to escape your JavaScript code in CDATA blocks:
> 
> <script type="text/javascript">// <![CDATA[ (function() {
> 	window.onload = function() {
> 		var mapDiv = document.getElementById
> ('map-39c3b9f0d181f0eb9e89531043148975');
> 		var latlng = new google.maps.LatLng(0,0); var options = {
> 			 center: latlng,
> 			 zoom: ]]>{map.zoom}<![CDATA[,
> 			 mapTypeId: google.maps.MapTypeId.ROADMAP, 
mapTypeControlOptions: {
> 				style:
> google.maps.MapTypeControlStyle.DROPDOWN_MENU,
> 				position: 
google.maps.ControlPosition.TOP, },
> 			navigationControl: true,
> 			navigationControlOptions: {
> 			style: google.maps.NavigationControlStyle.ANDROID
> 			 }
> 		};
> 		var map = new google.maps.Map(mapDiv, options); // Adding 
a marker to
> 		the map
> 		var marker = new google.maps.Marker(Array);
> 
> 	}
> })();
> // ]]></script>
> 
> HTH,
> Bastian



More information about the TYPO3-project-typo3v4mvc mailing list