Detect the browser version in Javascript
<HTML> <HEAD> <TITLE>Browser Detecti on</TITLE> </HEAD> <body> <SCRIPT LANGUAGE="JavaScript"> var browsername= navigator.appName var browserversion =...
View ArticleLoad and display a html page every 60 seconds using JQuery Load()
The load() function will asynchronously load the content of, and then insert that content into each of the selected elements, replacing any content that is already there. // Load and display a html...
View ArticleExample of jQuery.getScript() along with callback
The jQuery.getScript() function takes the URL of a file of JavaScript code as its first argument. It asynchronously loads and then executes that code. // Dynamically load a script from some other...
View ArticleDraw a 2D filled rectangle using Canvas
<!DOCTYPE html> <html> <head> <title>Canvas from scratch</title> <meta charset="utf-8"> <script...
View ArticleHow to draw a rectangle with outline using Canvas
<!DOCTYPE html> <html> <head> <title>Canvas Example</title> <meta charset="utf-8"> <script...
View ArticleDrawing filled paths with using Canvas
<!DOCTYPE html> <html> <head> <title>Drawing Paths with Canvas Example</title> <meta charset="utf-8"> <script...
View ArticleDrawing color filled rectangle with Canvas Example
<!DOCTYPE html> <html> <head> <title>Drawing color filled rectangle with Canvas Example</title> <meta charset="utf-8"> <script...
View ArticleExample for changing line width of rectangle with Canvas
<!DOCTYPE html> <html> <head> <title>Example for changing line width of rectangle with Canvas</title> <meta charset="utf-8"> <script...
View ArticleSet background image of excel worksheet using Javascript setbackgroundpicture
var oexcel = new ActiveXObject("excel.application"); oexcel.visible = true; var oworkbook = oexcel.workbooks.add; var oworksheet = oworkbook.worksheets(1);...
View ArticleExample to illustrate Inheritance using JavaScript
In the example we define a base object called Car, and Create sub object called ferrari that inherits attributes from Car. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">...
View ArticleExample to illustrate Polymorphism using JavaScript
To illustrate Polymorphism using JavaScript we define a base object called Automobile with attributes and behaviors. Then we create sub object called Mercedes and Porshce to share the Automobiles...
View ArticleExample of Encapsulation using JavaScript
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>JavaScript - Encapsulation Exercise</title> </head> <body> <p>...
View ArticleIllustrate how to manipulate JavaScript variables for web pages
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>JavaScript - Creating JavaScript variables for web pages 1</title> </head>...
View ArticleCreate a Monthly Auto Loan Payment Calculator in Javascript
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>JavaScript - Loan Calculator</title> </head> <script...
View ArticleCreate and display custom objects using JavaScript
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>JavaScript - Create and Display Object Types</title> </head> <script...
View Articlechange text decoration css using jquery
<head> <script type="text/javascript" src="jquery-1.7.21.7.2.js"> </script> <script type="text/javascript"> /* <![CDATA[ */ $(document).ready(function(){...
View ArticleBind event to event handler in jquery
<script type="text/javascript"> $(document).ready(function(){ $("#b1").bind("click", function() { var message="You clicked a button"; window.alert(message); }); }); </script>...
View ArticleCommon types of events in jQuery
.blur() .change() .click() .dblclick() .error() .focus() .focusin() .focusout() .hover() .keydown() .keypress() .keyup() .load() .mousedown() .mouseenter() .mouseleave() .mousemove() .mouseout()...
View ArticleConvert JSON to JavaScript Objects
JSON is the representation of a JavaScript object in string form. We can use the JSON.parse(string) method to convert a string that is properly formatted with JSON into a JavaScript object. var team =...
View ArticleTwo-way data binding with an input field in AngularJS
Two-way data binding is one of the important features of AngularJS. Two-way data binding makes sure that changes in the data model are automatically reflected in the corresponding elements in the view....
View Article