Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WEB APP TESTING USING KNOCKOUT.JS

You're reading from   WEB APP TESTING USING KNOCKOUT.JS Design, implement, and maintain a fully tested JavaScript web application using Knockout.JS

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783982844
Length 154 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Roberto Messora Roberto Messora
Author Profile Icon Roberto Messora
Roberto Messora
Arrow right icon
View More author details
Toc

Hello Knockout.JS

To start using Knockout.JS is very simple. It is nothing more than a couple of JavaScript lines of code and a special attribute added to the DOM tags.

An example of an HTML page can be as follows:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Hello Knockout.JS</title>
</head>
<body>
    <span data-bind="text: message"></span>
    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/knockout/3.1.0/knockout-min.js"></script>
    <script type="text/JavaScript">
        var viewModel = {
            message: "Hello Knockout.JS!"
        };
        ko.applyBindings(viewModel);
    </script>
</body>
</html>

Note

We put the script tags just before the closing body tag for performance reasons, as stated in the best practices document of the Yahoo Developer Network...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime