Код: Выделить всё
Company A
44.42, 26.95
45.30, 21.88
Company B
54.42, 66.95
...
Код: Выделить всё
$(document).ready(function()
{
$.ajax({
type: "GET",
url: "hardware.xml",
dataType: "xml",
success: parseXml
});
});
function parseXml(xml)
{
$(xml).find("marker").each(function()
var geo=$(this).find('geo').map(function(i,v){return ($(v).text());}).get();
for (i=0;i 0 && typeof geo[0] === 'string' && geo[0].includes(',')) {
const coords = geo[i].split(',').map(Number);
var lat = coords[0]; var long = coords[1];
var sub = $(this).find("geo").map(function(i,v){return ($(v).attr('comp'));}).get();
console.log(sub);
}
Код: Выделить всё
(2) ['HQ', 'SA plant']
Подробнее здесь: https://stackoverflow.com/questions/798 ... ing-jquery
Мобильная версия