Answer the question
In order to leave comments, you need to log in
Which side is wrong? PHP or JS?
https://www.vgl.su/tester/
There is such a page with a map. You can select country and city. But when you try to add additional cities and offices for Kazakhstan or Ukraine, the map stops working. How can you find out where the error is?
Answer the question
In order to leave comments, you need to log in
Look for the eternal loop in the JS code, the browser tab freezes tightly, loading the CPU cores.
UPD: I looked in the chrome debugger, it says that it hangs in this area.
$( "#ShipStates option:selected" ).each(function() {
var data_lat = $(this).attr("data-lat");
var data_long = $(this).attr("data-long");
for(var countrycode in dealersArray)
{ country = dealersArray[countrycode];
for(var citycode in country.cities)
{ city = country.cities[citycode]
for (var i = 0; i < city.offices.length; i++)
{ office = city.offices[i]
var latLng = new google.maps.LatLng(data_lat, data_long);
mapBuy.setZoom(11);
mapBuy.panTo(latLng);
return;
}
}
}
})
Where are they added? How are they added? How are they output?
What does the console write on error? What do the backend logs say?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question