Categories
KnockoutJS

Components of KnockoutJS

Components are way of organizing the UI code for structure wise and promote code re-usability for a large application. Components can be registered using the ko.components.register() API. ko.components.register(‘componentname’, { viewModel: {…}, template: {….) }); <!DOCTYPE html> <head> <title>Components of KnockoutJS</title> <script src=”https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js”></script> </head> <body> <h4>Example 1: without parameters</h4> <div data-bind=’component: “example-editor”‘></div> <h4>Example 2: passing parameters</h4> […]

Categories
Css3

Using calc() calculate values in css

calc() function is a good feature of CSS. For arithmetic calculations in CSS it is used. You can use it for percentages and pixels also. In IE9 towards it works also. This is a native CSS way for doing simple math in CSS which is a replacement for any length value. It has four simple […]

Categories
MySQL

MySQL copy table

It is very useful to copy table data from a old existing table to a new table when you need to back up data and replicating the production data for testing. To copy data from one table to another table, you can use CREATE TABLE and SELECT statements as follows. Simple example of copy table: […]

Categories
Html5

HTML5 Form Validation Examples

For an old days we used JavaScript validation to validate any form in a website and this was until recently unthinkable. But as soon as the HTML5 came then the validation becomes very easy to maintain in any form. Here is some example of HTML5 Form Validation: The ‘required’ attributeThis simply checks whether the value […]

Categories
AngularJS

AngularJS Modules

Modules are used to seperate logics and keep the code clean. So we can define modules in separate js file. Here we will create two modules i.e. Controller Module and Application Module. Controller Module: controller.jsHere we are declaring a controller userController module using myApp.controller function. myApp.controller(“userController”, function($scope) { $scope.user = { first_name: “Tim”, last_name: “Shawn”, […]

Categories
MySQL

Create Trigger in MySQL

Using CREATE TRIGGER statement you can create a trigger. You have to put the trigger name after the trigger statement. Let’s see an example of Create Trigger: For example we have two tables i.e. users and userhistory. users:userIDfirstNamelastName userhistory:userIDlast_update Read Also: INSERT … ON DUPLICATE KEY UPDATE Now we will create a trigger before update […]

Categories
KnockoutJS

KnockoutJS MVVM Application Framework

Now a days everyone use a single page application i.e. all necessary information are gathered into a single page and KnockoutJS is no exception of this which uses MVVM Application Framework. This is a client side framework which very easily bind html to domain data with MVVM pattern. MVVM is an architectural design pattern for […]

Categories
KnockoutJS

About KnockoutJS

In this tutorial you will get the basic knowledge of KnockoutJS and how to use on programming. Basically it is a JavaScript library based on MVVM pattern i.e. Model-View-View-Model by which developer build rich and responsive websites. It separates the application model, view and view model. It supports most of browsers i.e. Firefox 3.5+, IE […]

Categories
jQuery

SlidesJS, a jQuery responsive slideshow plug-in

SlidesJS is a jQuery responsive slideshow plug-in for version 1.7.1+ with various features like responsive, CSS3 transition. It has the following features: Responsive CSS3 transitions Touch effect Easy setup Options width (number) & height (number) start (number) navigation (object) pagination (object) play (object) effect (object) callback (function) Here is a simple example: <!doctype html> <head> […]

Categories
MySQL

Optimize a MySQL database

One of the important thing for achieving MySQL database performance is indexing that allows faster gathering of data to optimize MySQL database. Here is the list to Optimize MySQL database: Indexing in MySQL will create an internal register which is saved in by the MySQL service.For e.g.ALTER TABLE table_name ADD INDEX (column_name); There is another […]