in javascript when I wrap my functions (below) in either $(Document).ready(Function(){ ... }) or $function(){ ... } I receive errors that the my function AddContact or EditContact is not found. I am using MVC and this was what I thought would a remedy my issue with javascript being not found after HttpPost, so if someone could explain how to wrap these inside ot $.ready(function() maybe I could resolve both issues.
<script>
var AddContact = function (id) {
var url = "../Dataset/AddContact/" + id
$("#myModalBody").load(url, function () {
$("#myModal").modal("show");
})
};
var EditContact = function (id) {
var url = "../Dataset/EditContact/" + id
$("#myModalBody").load(url, function () {
$("#myModal").modal("show");
})
};
</script>