I have the following code:
<script type="text/javascript">
$(document).ready(function AjaxPost() {
alert('asd');
});
</script>
<body>
<input name="btnUpdateUser" value="Update" id="btnUpdateUser" type="button" onclick="AjaxPost()" />
</body>
My problem it is not working. See live sample here: CodePen
But when I changed the onclick to this:
<input name="btnUpdateUser" value="Update" id="btnUpdateUser" type="button" onclick="javascript:alert('asd');" />
It is showing the alert. What did I missed here? Thanks!
var AjaxPost = function() { ... }; $(document).ready(AjaxPost);