KnockoutJS – Templating

Using template is very easy to incorporate into website. For a duplication you don’t need to write over and over again just call them repetitively. Parameters: Following properties can be sent as a parameter-value: name, nodes, data, if, foreach, as, afterAdd, afterRender, beforeRemove. Lets see an example of Templating: <!DOCTYPE html> <head> <title>KnockoutJS – Templating</title> […]

Dependency Tracking – KnockoutJS

Using a single object called dependency tracker i.e. ko.dependencyDetection you can determine when the value get updated. When you declare a computed observable, KO immediately gets its initial value and updated computed observable. Lets see an example for Dependency Tracking: <!DOCTYPE html> <html> <head> <title>Dependency Tracking – KnockoutJS</title> <script src=”http://ajax.aspnetcdn.com/ajax/knockout/knockout-3.1.0.js” type=”text/javascript”></script> </head> <body> <div> <form […]

KnockoutJS – Observables

3 concepts in which KnockoutJS is build upon is: – Through observables dom elements and ViewModel exchange information – Bindings between UI and ViewModel – Templating web applications To make it observable declare as: this.property = ko.observable(‘value’); Let’s try below Observables example: <!DOCTYPE html> <head> <title>KnockoutJS – Observables</title> <script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/knockout/knockout-3.1.0.js”></script> </head> <body> <!– This […]

JSON with Ajax

Ajax is Asynchronous JavaScript and XML for for asynchronous web applications. Using ajax data from a server asynchronously retrieved and display without reloading the page. So JSON with Ajax is no exception. JSON stands for JavaScript Object Notation. So, in simple terms JSON is a way of formatting the data. For, e.g., transmitting it over […]

Syntax of JSON

Basically Syntax of JSON is the subset of the JavaScript syntax. It has following notation: Data is represented in name/value pairs. The name/value pairs are separated by , (comma). Curly braces hold objects. Square brackets hold arrays. Below is a example of Syntax of JSON: {“students”:[ {“Name”:”Tim”, “Age”:”25″}, {“Name”:”John”, “Age”:”30″}, {“Name”:”Jane”, “Age”:”45″} ]} So, students[0].Name […]