This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
var [variableName] = function [functionName] (param1, param2, .., paramN) { | |
statements | |
} | |
*/ | |
//Eg1: | |
//a function expression of an anonymous function assigned to the variable multiply | |
var multiply = function(x, y) { | |
return x * y; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pattern: | |
new Function (arg1, arg2, ... argN, functionBody) | |
*/ | |
//Eg: | |
//a function defined with the Function constructor assigned to the variable multiply | |
var multiply = new Function("x", "y", "return x * y;"); | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Eg1: */ | |
var x = 0; // source element | |
if (x == 0) { // source element | |
x = 10; // NOT a source element | |
function boo() {} // NOT a source element | |
} | |
function foo() { // source element | |
var y = 20; // source element |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Eg.1: */ | |
function foo() {} | |
alert(foo); // alerted string contains function name "foo" | |
var bar = foo; | |
alert(bar); // alerted string still contains function name "foo" | |
bar = "asd"; | |
alert(bar); //alerted string is now "asd" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Eg.1: */ | |
var y = function p() {}; | |
alert(y); // works! | |
alert(p); // throws an error!! | |
var q; | |
var z = function q() {}; | |
alert(z); // works! | |
alert(q); // undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function r() {}; //Case of function declaration | |
alert(r); //works!!! outputs r serialized into a string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo(); // alerts FOO! | |
function foo() { | |
alert('FOO!'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Window Size Bookmarklet: see the size of any page to debug CSS3 media queries and adaptive layouts | |
// Source: http://www.josscrowcroft.com/2011/code/window-size-bookmarklet/ | |
// javascript:(function(){var f=document,a=window,b=f.createElement("div"),c="position:fixed;top:0;left:0;color:#fff;background:#222;padding:5px 1em;font:14px sans-serif;z-index:999999",e=function(){if(a.innerWidth===undefined){b.innerText=f.documentElement.clientWidth+"x"+f.documentElement.clientHeight;}else if(f.all){b.innerText=a.innerWidth+"x"+a.innerHeight;}else{b.textContent=window.innerWidth+"x"+window.innerHeight;}};f.body.appendChild(b);if(typeof b.style.cssText!=="undefined"){b.style.cssText=c;}else{b.setAttribute("style",c);}e();if(a.addEventListener){a.addEventListener("resize",e,false);}else{if(a.attachEvent){a.attachEvent("onresize",e);}else{a.onresize=e;}}})(); | |
// Code above is beautified below for easy reading: | |
(function () { | |
var f = document, | |
a = window, | |
b = f.createElement("div"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test Page</title> | |
</head> | |
<body> | |
This is a test page :P | |
</body> | |
<!-- This script got to be at the rock bottom so that | |
the dom (<body> in particular) is loaded for the JS to work--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList arrlstCbosPagedDetails; | |
ArrayList arrlstCbosTotalDetails; | |
String sOperation = request.getParameter(ABCConstants.OPERATION); | |
int iTotalRecords = objConsolidatedBOSForm.getTotalRecords(); |