Reputation: 1
I have some troubles with the jquery plugin Tooltipster and ajax :
Here is my code :
var id = $(this).attr("scope");
var tp = $(this).attr("id");
$(this).tooltipster({
interactive:true,
contentAsHTML: true,
position: 'top',
content: 'Chargement...',
delay: '0',
speed: 150,
trigger: 'click'
functionBefore: function(origin, continueTooltip) {
continueTooltip();
$.ajax({
type: 'GET',
url: '/ajax/platform.php',
data: {variable1: variable1, variable2: variable2},
success: function(data) {
origin.tooltipster('content', data).data('ajax', 'cached');
}
});
},
theme: 'tooltipster-shadow'
});
});
Ajax send me html like :
<input type="text" name="input1" id="input1">
How can I do to interact with #input1 with jquery ?
Upvotes: -1
Views: 45
Reputation: 1
It works like that :
var id = $(this).attr("scope");
var tp = $(this).attr("id");
$(this).tooltipster({
interactive:true,
contentAsHTML: true,
position: 'top',
content: 'Chargement...',
delay: '0',
speed: 150,
trigger: 'click'
functionBefore: function(origin, continueTooltip) {
continueTooltip();
$.ajax({
type: 'GET',
url: '/ajax/platform.php',
data: {variable1: variable1, variable2: variable2},
success: function(data) {
origin.tooltipster('content', data).data('ajax', 'cached');
$("#input1").click(function(d) {
d.preventDefault();
alert("It works !");
});
}
});
},
theme: 'tooltipster-shadow'
});
});
Upvotes: 0