Quantcast
Channel: w3mentor » Javascript
Browsing all 100 articles
Browse latest View live

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 Article


Load 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 Article


Example 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 Article

Draw a 2D filled rectangle using Canvas

<!DOCTYPE html> <html> <head> <title>Canvas from scratch</title> <meta charset="utf-8">   <script...

View Article

How to draw a rectangle with outline using Canvas

<!DOCTYPE html> <html> <head> <title>Canvas Example</title> <meta charset="utf-8">   <script...

View Article


Drawing filled paths with using Canvas

<!DOCTYPE html> <html> <head> <title>Drawing Paths with Canvas Example</title> <meta charset="utf-8">   <script...

View Article

Drawing 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 Article

Example 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 Article


Set 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 Article


Example 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 Article

Example 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 Article

Example 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 Article

Illustrate 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 Article


Create 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 Article

Create 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 Article


change 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 Article

Bind 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 Article


Common types of events in jQuery

.blur() .change() .click() .dblclick() .error() .focus() .focusin() .focusout() .hover() .keydown() .keypress() .keyup() .load() .mousedown() .mouseenter() .mouseleave() .mousemove() .mouseout()...

View Article

Convert 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 Article

Two-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
Browsing all 100 articles
Browse latest View live