Archive for the Java Script Category

Description:

List Articles

How do I get the value after hash (#) from a URL using javascript

var url ='www.site.com/index.php#hello'; var type = url.split('#'); var hash = ''; if(type.length > 1) hash = type[1]; alert(hash); Another simple technique is.. var type = window.location.hash.substr(1); ...more

Dynamically load css and js files using JavaScript

function loadjscssfile(filename, filetype) { if (filetype == "js") { //if filename is a external JavaScript file // alert('called'); var fileref = document.createElement('script') fileref.setAttribute("type", "text/javascript") fileref.setAttribute("src", filename) alert('called'); } else if (filetype == "css") { //if filename is an external CSS file va ...more

html5 – the valueAsNumber Function

The new valueAsNumber function is a handy way to convert the value of a control from text to number… and back! That is the case because the valueAsNumber is both a getter and a setter function. When called as a getter, the valueAsNumber function converts the text value of an input field into a number type upon which calculations are allowed. If the text value does not cleanly convert into a number type, then the NaN value (Not-a-Number) is returned. The valueAsNumber can also be used to set ...more

Convert JavaScript array into string

The following JavaScript function converts an array into string. function ArrayToString (args) {

if (typeof JSON == "undefined") {

var s = "[";

...more

Convert ticks into JavaScript date object

This little function convert the ticks into JavaScript datetime object. function ConvertTicksToDate(pTicks) {             try {

     var dateTimeObject;

                dateTimeObject = new Date((pTicks - 621355968000000000) / 10000);

...more

Convert JavaScript datetime into ticks

Following javascript function convert the JavaScript datetime object into ticks. This function accepts the 2 arguments first is datetime and the 2nd is dateFormat, dateFormat defines the datetime in universal format or user local datetime setting. first, define the dateformat as DateFormat = {

UniversalTime: 0,

...more

HTML5 API’s, checking for browser support

In this article i will discuss how to check the different HTML5 API's  that your browser supports or not. Canvas try {

document.createElement("canvas").getContext("2d");

document.getElementById("support").innerHTML ="HTML5 Canvas is supported in your browser."; ...more

Serializing a form to server using Ajax/JQuery.

This is how a form could be serialized to server. $.ajax({ data: $("form").serialize(), //rest  }); It does not require building data by getting value of each field individually. ...more

HTML5 Web Storage API

The Web Storage API is surprisingly simple to use. i will start by covering simple storage and retrieval of values and then move on to the differences between session and local storage. Setting and Retrieving Values For now, i will focus on the session storage capability as you learn to set and retrieve simple values in a page. Setting a value can ea ...more

 
May 2013
M T W T F S S
« Oct    
 12345
6789101112
13141516171819
20212223242526
2728293031  
Technologies