На самом деле не так уж много людей из JS - так может кто-нибудь объяснить, почему это не работает? Я хочу вызвать предопределенную функцию в одном скрипте из моего простого скрипта AJAX - я просто хочу, чтобы он вызывал функциональность qtip для содержимого div, переданного на страницу через AJAX.
Спасибо,
H
SCript 1 - AJAX loader
if(myHttpRequest.readyState==4)
data.innerHTML = myHttpRequest.responseText;
qtip_me('.div_to_act_on');
}
Скрипт 2 - основной скрипт JQuery
$(document).ready(function() {
function qtip_me(a) {
$(a).each(function() {
$(this).qtip({
content: {'showme'},
position: {corner: {tooltip: 'bottomLeft', target: 'topRight'}},
style: {
width: 300,
padding: 5,
background: '#A2D959',
color: 'black',
textAlign: 'center',
border: {
width: 7,
radius: 5,
color: '#A2D959'
},
tip: 'bottomLeft',
name: 'dark' // Inherit the rest of the attributes from the preset dark style
}
});
});
};
});