MVCHaack Ajax Demo

Simple Comics Post Demo


comicspostdemo.html
<script src="../../Scripts/jquery-1.6.2.js" type="text/javascript"></script>
<script src="/json/comicsdemo?json"></script>
<script src="/Scripts/comicsdemo.js"></script>

<h2>Simple Comics Post Demo</h2>

<button id="post">Click to post a comic to the server</button>

<script>
    $(function() {
        $('#post').click(function() {
            $mvc.ComicsDemo.Save({ Title: 'Adventurers', Issue: 123 }).success(function(data) {
                alert(data.message + ' Comic: ' + data.comic.Title);
            });
        });
    });
</script>