Reputation: 43
I'm working with the following plugin: http://jqvmap.com/ with brought me a proper map of a country with its distinct regions.
I want to refresh the page with post data to filter some information when a click occurs. I used the load function which seems pretty easy to use but even if the function is reached, nothing happens afterwards.
Here is the jQuery:
$(document).ready(function() {
$('#francemap').vectorMap({
map: 'france_fr',
hoverOpacity: 0.5,
hoverColor: "#EC0000",
backgroundColor: "#444444",
color: "#FACC2E",
borderColor: "#000000",
selectedColor: "#EC0000",
enableZoom: false,
showTooltip: true,
onRegionClick: function(element, code, region)
{
var url = "home";
$(document).load(url, {region:region});
}
});
});
So if I basically clic on a region: nothing happens. Even thought the onRegionClick function is reached.
My bet is that it is a "DOM level issue" like i'm calling the document selector inside the $("#francemap") but I can't make sure and moreover I don't know how to overcome this.
Thank you for reading me
Upvotes: 0
Views: 440
Reputation: 2833
If you want to refresh the page, u need
window.location = url+"#"+region;
$(document).load(function() {})
// Bind an event handler to the "load" JavaScript event.
Here's an example
Upvotes: 1