How to include javascript file in html dynamically

Try this.


$.ajax({
url: 'library.js',
dataType: 'script',
async: false, //if you change this true, you may receive the error
success: function () {

}
});

#ajax, #dynamic-javascript, #dynamics-library