I tried running my javascript code which is declarete in same file with ajax loadContent function. My problem is, after loading content, that function do not work.
I looked for solution, and i found .live() method in jQuery but I'm using 1.9 version which not support that now.
Here im loading spreadsheet to html doc:
var spreadsheet = $( 'div#item-list table > tbody' );
function loadContent(){
$.post( 'ajaxRequest.php', { 'function' : 'loadData' } )
.done( function( content ){
spreadsheet.empty().append( content );
});
}
In this same file i have this code: Before i loaded action buttons into spreadsheet, and now i would like do some action with form like "removerow"
$('input[name="removerow"]').on( "click" , function (){
$.post( 'ajaxRequest.php', { 'function' : 'removerow', 'ID' : ID } )
.done( function( result ){
alert(result);
});
return false;
});
Problem is in javascript, not PHP, I'm sure that on 100%.
Thanks in advance!