Hi I use an ajax script to get var new_sample_data
. In my .php I have an second javascript file included. There I need also the variable new_sample_data
to show an tooltip.
First javascript file:
$.ajax({
type: "POST",
url: '../assets/includes/geodata1.php',
data: {datum1: Date.today().add({days: -29}).toString('yyyy-MM-dd'), datum2: Date.today().toString('yyyy-MM-dd')},
dataType: 'json',
success: function(data)
{
var new_sample_data = data;
But any I do I don't get the values from the var new_sample_data
in the second javascript file. Allways 0.
I tried to set manual var new_sample_data = "de":"4"
in the if(params.showTooltip) and it works for the manual value. But I don't find my error :-)
Code from second java scrpit file:
if (params.showTooltip) {
map.label.text(mapData.pathes[code].name + " - Öffnungen: " + sample_data[code]);
jQuery(params.container).trigger(labelShowEvent, [map.label, code]);