Home » Java Script
Description:
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
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
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
Sample Check Box ...more
The following JavaScript function converts an array into string. function ArrayToString (args) {
if (typeof JSON == "undefined") {
var s = "[";
This little function convert the ticks into JavaScript datetime object. function ConvertTicksToDate(pTicks) { try {
var dateTimeObject;
dateTimeObject = new Date((pTicks - 621355968000000000) / 10000);
...moreFollowing 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,
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
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
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
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Oct | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||