Knockout.js AJAX获取

I am new to using Knockout.js and for that matter JavaScript as well. I went through their tutorials and tried to modify the example to load data from server as below. Can anyone please point what's wrong with my code

JavaScript:

jQuery(document).ready(function () {

    MyViewModel = function()
    {
        var self =this;
        self.name = ko.observable("");

        self.getJson = function()
        {
            jQuery.ajax({
                //Do all the work
                success: function(data)
                {
                    self.name = data.name;
                }              

            });
        }
    }

    myViewModelObj = new MyViewModel();
    ko.applyBindings(myViewModelObj);
    myViewModelObj.getJson();

});

View:

 <h1 data-bind="text: name "></h1>

After you have declare an object to be an observable, it then becomes a native function to knockout. In order to update the value, use

self.name(data.name);

Otherwise you are overwriting the function.