How to we call a function from an external JS file on click?
JS file on /Content/js/pj_no.js
function alertMe(){
alert("me");
}
C#
@Scripts.Render("~/Content/js/pj_no.js")
<input value="親コード新規登録" type="button" onclick="alertMe()" />
Assuming this is in the same file iin my csHTML it is working fine. But when I put it on the external JS it is not calling anymore.
I know my JS is in the right directory as if i trigger an $(document).ready(function () {} it is calling the alert. But I need it to be on click event.
Help please
$(document).ready(function (
alert("me"); -- This is working,
function alertMe(){ //cant call this function
alert("me");
}
)});


pj_no.jsindependently with your view?(document).ready? in the C# view?