PHP function into the main Javascript
-
Great plugin, martynasma, really great.
I am trying to set a really simple widget, starting from the default “Zooming to Countries Map”, which will have next to each country name the count of posts published for that country (the categories are the country names, I have a travel blog :)).
I am trying to include some PHP code to dynamically get the post count by category, but actually I don’t know if it’s possible to add php code in it, since neither the simplest echo uses to work, as you can see in my code below:
var map = AmCharts.makeChart("chartdiv", { "type": "map", "theme": "none", "pathToImages": "http://www.amcharts.com/lib/3/images/", "dataProvider": { "map": "worldLow", "getAreasFromMap": true, "areas": [{"id": "US","title":"United States ("+<?php echo '16' ?>+")"}] }, "areasSettings": { "autoZoom": true, "color": "#0063be", "rollOverColor": "#ffb511", "rollOverOutlineColor": "#ffffff", "selectedColor": "#ffb511", "outlineThickness": 2 }, "smallMap": {} });Could you please help me to achieve what I need?
Thank you
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘PHP function into the main Javascript’ is closed to new replies.