Being very (very) new to JavaScript, I am stuck with the following problem when using JQuery VectorMaps:
When I am highlightening a country with this syntax, everything works perfectly:
jQuery('#vmap').vectorMap('set', 'colors', { 'us': '#1caf9a' });
However when I put exactly 'us'
into a variable, say country_name
like this :
jQuery('#vmap').vectorMap('set', 'colors', { country_name : '#1caf9a' });
it doesn't work - I don't understand why?
when putting alert(country_name)
it gives exactly 'us'
.
Also country_name
cannot be auto-completed in this situation, because of the presence of :
Could anyone please help me ?
Thanks.