Answer the question
In order to leave comments, you need to log in
How can I connect the required library for a specific js file or a separate function?
I use Yandex maps, their library is connected accordingly. When I start debugging, then in the part where the map function is called, there are conflicts with the previously included jquery library.
function onAjaxSuccess(data)
{
// Здесь мы получаем данные, отправленные сервером и выводим их на экран.
if (data != 'Добавили новое место!')
{
//alert('Вот это прикол!'); здесь добавить на карту наши объекты
//alert($.parseJSON(data));
var b = $.parseJSON(data);
//alert(b[1].thelocation);
//alert(b.length);
var p = 0;
while (p < b.length) {
//alert( 'тут будем создавать объекты на основании массива' );
myGeoObject = new ymaps.GeoObject({
geometry: {
type: "Point",// тип геометрии - точка
coordinates: [b[p].w, b[p].l] // координаты точки
}
});
moscow_map.geoObjects.add(myGeoObject);
p++;
}
}
else
{
alert(data);
}
}
}
Answer the question
In order to leave comments, you need to log in
Comment out your function call and wire it up:
getUsers({
param1: $('#value1').val(),
param2: $('#value2').val(),
param3: $('#value3').val()
});
function getUsers (params) {
$.ajax({
url: 'obrabotka.php',
data: params,
dataType: 'json'
}).done(function (data) {
console.log('success', data);
}).fail(function (data) {
console.log('error', data);
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question