Friebug error : TypeError: e is null ...or(var f=a.e.firstChild(e);e=f;)f=a.e.nextSibling(e),c(b,e,d)}function c(c,e,f){...

1,953 views
Skip to first unread message

jose.samb...@gmail.com

unread,
Jul 27, 2013, 8:26:33 AM7/27/13
to knock...@googlegroups.com
Hi group,

I m new in Knockout , i have dowloaded it the library and try first example but i don't get to work , i m copying  the entire script so you can take a look at it and see what  i m doing wrong

<html>
    <head>
<script type='text/javascript' src="scripts/jquery-1.10.2.min.js"></script>
<script type='text/javascript' src="scripts/knockout-2.3.0.js"></script>
<script type='text/javascript'>
       
       
        var ViewModel = function(first, last) {
    this.firstName = ko.observable(first);
    this.lastName = ko.observable(last);
 
    this.fullName = ko.computed(function() {
        // Knockout tracks dependencies automatically. It knows that fullName depends on firstName and lastName, because these get called when evaluating fullName.
        return this.firstName() + " " + this.lastName();
    }, this);
};
        ko.applyBindings(new ViewModel("Planet", "Earth"));
        
</script>
    </head>
    <body>
        <p>First name: <input data-bind="value: firstName" /></p>
<p>Last name: <input data-bind="value: lastName" /></p>
<h2>Hello, <span data-bind="text: fullName"> </span>!</h2>
   
    </body>
</html>
knowout-testing.zip

Patrick Steele

unread,
Jul 27, 2013, 9:25:42 AM7/27/13
to knock...@googlegroups.com
Try putting your applyBindings in the document.ready handler:

$(function() {
        ko.applyBindings(new ViewModel("Planet", "Earth"));
});


--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jose Sambrano

unread,
Jul 27, 2013, 10:08:50 AM7/27/13
to knock...@googlegroups.com
thanks a lot , it worked, 

Great Group.




--
You received this message because you are subscribed to a topic in the Google Groups "KnockoutJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/knockoutjs/nvLZSefuZI8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to knockoutjs+...@googlegroups.com.

sergiu neamt

unread,
Jul 28, 2013, 5:52:29 AM7/28/13
to knock...@googlegroups.com, jose.samb...@gmail.com
Or better, move the entire script section behind the html, will work as well.

soumenk...@gmail.com

unread,
Nov 21, 2013, 12:29:35 PM11/21/13
to knock...@googlegroups.com
Thanks friend...
Reply all
Reply to author
Forward
0 new messages