Tag: js

Finding the Factorial using Recursion

Finding the Factorial using Recursion in javascript. function factorial(x) { if(x

Chainable interface in JavaScript

Creating Chainable interfaces in javascript… (function() { function _init() { return this; } _init.prototype = { “myFunction”: function() { return…

Execute JavaScript files using Rhino

The command to execute a javascript file using rhino. java -jar /path/to/custom_rhino.jar JS_File.js Get Custom Rhino(From Dojo Library)

Find Element’s Position using JavaScript

Find the position of an element using javascript function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) {…