Javascript Magic
Use your Internet Explorer Browser as a Calculator!
Type this single line into the "Address" (URL) textarea
of your IE Browser and press Enter.
javascript:7+4
and you should get the answer 11 on the window page.
Now do the same for -
javascript:alert(8-5)
and you should get the answer 3 in an alert box.
Now try these -
javascript:'Math Class'
javascript:alert('This is Math Class')
javascript:Date()
javascript:alert(Date())
Again, Type the following single line Math expression into the
"Address" (URL) textarea of your IE Browser and press Enter.
javascript:Math.cos(1.5)
Now do the same for -
javascript:alert(Math.PI)
Also, type these inside the above two examples -
Math.abs(number) ....absolute value
Math.acos(number) ....arc cosine (in radians)
Math.asin(number) ....arc sine (in radians)
Math.atan(number) ....arc tangent (in radians)
Math.cos(num_radians) ....cosine
Math.sin(num_radians) ....sine
Math.tan(num_radians) ....tangent
Math.ceil(number) ....smallest integer >= number
Math.floor(number) ....largest integer <= number
Math.exp(number) ....e to the power of number
Math.log(number) ....natural log of number
Math.pow(base,exponent) ....base to exponent power
Math.max(number,number) ....greater of the two numbers
Math.min(number,number) ....smaller of the two numbers
Math.round(number) ....rounds the number to the nearest integer
Math.sqrt(number) ....finds the square root of the number
Math.PI .... pi (3.14159...)
Math.E ....e (2.718...)
Math.LN2 ....natural log of 2 (0.693...)
Math.LN10() ....natural log of 10 (2.302...)
Math.LOG10E() ....base 10 log of e (0.434...)
Math.SQRT1_2() ....square root of 1/2 (0.707...)
Math.SQRT2 ....square root of 2 (1.414...)
Contributed by www.TheMathWebSite.com.
Type this single line into the "Address" (URL) textarea
of your IE Browser and press Enter.
javascript:7+4
and you should get the answer 11 on the window page.
Now do the same for -
javascript:alert(8-5)
and you should get the answer 3 in an alert box.
Now try these -
javascript:'Math Class'
javascript:alert('This is Math Class')
javascript:Date()
javascript:alert(Date())
Again, Type the following single line Math expression into the
"Address" (URL) textarea of your IE Browser and press Enter.
javascript:Math.cos(1.5)
Now do the same for -
javascript:alert(Math.PI)
Also, type these inside the above two examples -
Math.abs(number) ....absolute value
Math.acos(number) ....arc cosine (in radians)
Math.asin(number) ....arc sine (in radians)
Math.atan(number) ....arc tangent (in radians)
Math.cos(num_radians) ....cosine
Math.sin(num_radians) ....sine
Math.tan(num_radians) ....tangent
Math.ceil(number) ....smallest integer >= number
Math.floor(number) ....largest integer <= number
Math.exp(number) ....e to the power of number
Math.log(number) ....natural log of number
Math.pow(base,exponent) ....base to exponent power
Math.max(number,number) ....greater of the two numbers
Math.min(number,number) ....smaller of the two numbers
Math.round(number) ....rounds the number to the nearest integer
Math.sqrt(number) ....finds the square root of the number
Math.PI .... pi (3.14159...)
Math.E ....e (2.718...)
Math.LN2 ....natural log of 2 (0.693...)
Math.LN10() ....natural log of 10 (2.302...)
Math.LOG10E() ....base 10 log of e (0.434...)
Math.SQRT1_2() ....square root of 1/2 (0.707...)
Math.SQRT2 ....square root of 2 (1.414...)
Contributed by www.TheMathWebSite.com.