Book Image

KnockoutJS Web Development

Book Image

KnockoutJS Web Development

Overview of this book

Table of Contents (13 chapters)
KnockoutJS Web Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Unmapping your data


This is coming along good but there is something we are going to need for most AJAX-based web applications. We are going to need to store the data back on the server. Pulling the data to the browser will not be enough. We will require the ability to push the data back to the server as well. Once again, we will be using jQuery for this function. Of course, we will show the code to do this but we will approach it differently because different readers will be using different backends such as ASP.NET, ColdFusion, Node.js, PHP, Python, Ruby, and others.

This time, just modify the code in the AJAX.html file unless, of course, you want to create a new file. We will be adding another button to our View to connect a push data method this time:

<button data-bind="click:pushData">Push Data</button>

We will also need to put a textbox at the end of our View code to see the data that is pulled out of our ViewModel. Create the textarea field to hold the results:

<textarea...