Example of a closure function

<!DOCTYPE hmtl> <html> <body> <script> var alertMsg =...

Block-scope mimicking

<!DOCTYPE html> <html> <body> <script> function getAddr(...

Privileged methods inside a constructor

<!DOCTYPE html> <html> <body> <script> function AccountD...

Privileged methods through module patterns

<!DOCTYPE html> <html> <body> <script> var AccountDetail...

Window object example

<!DOCTYPE html> <html> <head> <style type="text/...

Finding window's coordinates

<!DOCTYPE html> <html> <body> <button onclick=pos()>P...

Calculating window's size

<!DOCTYPE html> <html> <body> <button onclick=getSize()&...

The windows.object method

<!DOCTYPE html> <html> <head> <script> function popFun...

Example of a proper way of using pop-up

<!DOCTYPE html> <html> <body> <img onmouseover="bi...

Setting and clearing interval timer

<!DOCTYPE html> <html> <head> <script> //Counter incr...