jQuery click is triggering twice (once on page load and on click), but should fire the event when I click on the list item.
HTML:
<ul>
<li id="toolbar-save">
<i class="fa fa-fw fa-save"></i>
<span>Save</span>
</li>
</ul>
jQuery:
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
$("#toolbar-save").click(function() {
CallValidateMethod();
});
function CallValidateMethod(Model) {
$.ajax({
url: '@Url.Action("Validate", "Customer")',
type: 'GET',
dataType: 'JSON',
cache: false,
data: { Model: Model },
}).done(function() {
alert('Added');
});
}