Search icon CANCEL
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
KnockoutJS Web Development

You're reading from   KnockoutJS Web Development Efficiently work with data, web templates, and custom HTML tags using KnockoutJS

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781782161028
Length 178 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
John Farrar John Farrar
Author Profile Icon John Farrar
John Farrar
Arrow right icon
View More author details
Toc

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...
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