[TYPO3-mvc] Fluid objects inside javascript doesn't work
Bastian Waidelich
bastian at typo3.org
Sun Nov 14 12:19:51 CET 2010
Fernando Arconada wrote:
Hi Fernando,
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