Im using jQuery Vector Maps v1.5.0 in my application. The idea is to display a Map and when people click on a country an application cookie with country name is created.
At this moment I create the following code:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#vmap').vectorMap(
{
map: 'world_en',
onRegionClick: function (element,code,region,event)
{
if (
code == "AF" ||
code == "AL" ||
code == "DZ" ||
code == "AO" ||
code == "ZW")
event.preventDefault();
else onClick().replace(Cookie::queue('geo', code,'3600'));
},
onRegionOver:function(event, code, region){
if (
code == "AF" ||
code == "AL" ||
code == "DZ" ||
code == "AO" ||
code == "ZW")
{ document.body.style.cursor ="default";}
else
{ document.body.style.cursor ="pointer"; }
},
onRegionOut:function(element, code, region){
document.body.style.cursor ="default";
}
});
});
</script>
where onClick().replace(Cookie::queue('geo', code,'3600'));
must create the cookie if actual code != with clicked country.
At this moment I cannot make it work in this way. the cookie is not created. any help appreciated, im a newbie with javascript.