i have a function for select data in external file js
function show_all() {
work = "select";
$.ajax({
type: "POST",
url: "server.php",
data: "work="+work,
success: function(data) {
$("#boxtop").html(data);
$('#boxtop').animate({
scrollTop: $('#boxtop').get(0).scrollHeight}, 0);
}
});
}
and document ready work in html index but dont work in external file js
$(document).ready(function(e) {
show_all();
});