I have tow file first is index.php and the another is user.js I included user.js into index.php file . but the scripts functions not working from external file so if I put this functions directly in index.php it working perfectly but not working when putting them in external file
<script src="js/user.js" type="text/javascript"></script>
This is function which is into users.js
.
function deletemessage(id) {
var parent = $(this).parent().parent();
$.ajax({
type: 'get',
url: 'Save.php?id=delete_msg&msg_id=' + id,
beforeSend: function() {
parent.animate({
'backgroundColor': '#fb6c6c'
}, 300);
},
success: function(data) { //alert(data);
$('#message_ha').html(data);
parent.slideUp(300, function() {
parent.remove();
});
}
});
}