I have a View in which I'm having a script tag and I want to use the function present in another JS file. If I add the AddScrollBar() in the same script file it works , but I want to use in multiple places. So I have it in site.js. When The page gets loaded I can see the script tag of site.js getting loaded.
View with script
<script type="text/javascript">
function LoadXyz() {
$.ajax({
url: '/ABC/Xyz/' + @Model.Number,
success: function (data) {
LoadContainerData(data);
AddScrollBar();
}
});
$("#navMenu > li").removeClass("active");
$("#Xyz").addClass("active");
}
Any ideas on how can I use AddScrollBar() present in site.js