smarty variables inside javascript -


I am trying to use smart variables inside javascript inside SPL

  {Literal} & lt; Script language = "javascript" & gt; Google.load ('Visualization', '1', {'packages': ['geomap']}); Google.setOnLoadCallback (drawMap); Function drawMap () {var data = new google.visualization.DataTable (); Data.addRows (4); Data.addColumn ('string', 'location'); Data.addColumn ('number', 'number of links'); {/ Literal} {foreach = $ last5 item = link name = links key = index} data .setValue ({$ index}, 0, '{$ link.location: replace:' \ '': '\\\' '}'); Data.setValue ({$ index}, 1, {$ link.location_count}); {/ Foreach} {literal} var option = {}; Option ['dataMode'] = 'fields'; Option ['field'] = 'world'; Var container = document.getElementById ('map'); Var geomap = new google.visualization.GeoMap (container); Geomap.draw (data, options); }; & Lt; / Script & gt; {/ Literal}  

Can you recommend me a solution

< P> Just before the inclusion of the SmartView variable, close the {literal} tag, and open it again.

Or use {ldelim} and {rdelim} for pieces of code where you specify value from the smartie


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -