Everything is in the title ...
I created a code running on an element range:
(function($){
$('.range').each(function(){
var range = $(this);
range.on('input', function(){
range.next().text($(this).val());
})
.next().text(range.val());
});
})(jQuery);
I wish it also works on the same element called by Ajax.
$('.ajax-global').on('click', function(){
var param = $(this).attr('id');
$('.ajax-window').load('./Ajax/' + param + '.php');
});
Here is a practical example of these tags Range: online example.
If I call the same html code via Ajax, javascript does not apply to the latter. Code with Ajax (press the "Welcome Stackoverflow" button).
How to proceed? This is a dilemma that I can not solve, and that for a while ...
EDIT :
I remembered a useful function: $.getScript(), I'm almost there:
$('.ajax-global').on('click', function(){
var param = $(this).attr('id');
// Ouverture dans une fenêtre ajax généraliste :
$('.ajax-window').load('./Ajax/' + param + '.php', function() {
$.getScript( "./Scripts/Public/Scripts.js");
});
});
It works ... except that the file called is reapplied to the entire document, whereas I want to limit only to new html elements called via Ajax (in order to limit the bugs).