Q: Javascript - unable to call function from another file I'm trying to call a function from one file in another js file.
general.js
function delete_post(post_id, post_type, nonce) {
    $.post(Ajax.ajaxurl, { action: 'delete_post', post_id: post_id, nonce: nonce, post_type: post_type}, function (data) {
        var result = $.parseJSON(data);
        if (result.status == 'error') {
            $('#post_'+post_id).prepend('<div class="alert alert-danger">' + result.message + '</div>');
        }
        if (result.status == 'success') {
            $('#post_'+post_id).fadeOut(1000, function(){

                $(this).remove();
            });
        }
    });
}

details.js
$('body').on('click', '.remove-row', function (e) {
    e.preventDefault();
    var post_id = $(this).attr('data-target');
    var nonce = $(this).attr('data-nonce');
    var parent_id = $(this).attr('data-parent');
    var post_type = $(this).attr('data-post_type');
    bootbox.confirm(Ajax.are_you_sure, function(result) {
        if (result) {

            delete_post(post_id, post_type, nonce);

        }
    });
});

On the page they are loaded in the correct order:
<script type='text/javascript' src='http://domain.com/js/general.js?ver=3.9.1'></script>
<script type='text/javascript' src='http://domain.com/js/details.js?ver=3.9.1'></script>

However, when I click on the remove-row button, I get Uncaught ReferenceError: delete_post is not defined.
What am I missing?

A: That error tells us that you haven't shown all of general.js, and in particular that your function declaration for delete_post is inside another function (one possible example below). So it's not a global.
If you want to make it a global, you can do that by putting this line in general.js:
window.delete_post = delete_post;

The properties of the window object are globals.
In general, I would recommend keeping globals to a minimum, so you might want to have a single global object you use for all your stuff, along these lines:
if (!window.myApp) {
    window.myApp = {};
}
window.myApp.delete_post = delete_post;

...and then instead of
delete_post(post_id, post_type, nonce);

...in your other file, use
myApp.delete_post(post_id, post_type, nonce);


When I say it's inside another function, here's one example of that:
$(document).ready(function() {

    function delete_post() {
        // ...
    }

});

Your example may look slightly different, but that's the gist.
