JAVASCRIPT
LINKS BELOW
LINKS BELOW
In JavaScript you cannot use these reserved words as variables, labels, or function names:
abstract
arguments
await*
boolean
break
byte
case
catch
char
class*
const
continue
debugger
default
delete
do
double
else
enum*
eval
export*
extends*
false
final
finally
float
for
function
goto
if
implements
import*
in
instanceof
int
interface
let*
long
native
new
null
package
private
protected
public
return
short
static
super*
switch
synchronized
this
throw
throws
transient
true
try
typeof
var
void
volatile
while
with
yield
Words marked with* are new in ECMAScript 5 and 6.
You can read more about the different JavaScript versions in the chapter JS Versions.
The following reserved words have been removed from the ECMAScript 5/6 standard:
abstract
boolean
byte
char
double
final
float
goto
int
long
native
short
synchronized
throws
transient
volatile
Do not use these words as variables. ECMAScript 5/6 does not have full support in all browsers.
You should also avoid using the name of JavaScript built-in objects, properties, and methods:
Array
Date
eval
function
hasOwnProperty
Infinity
isFinite
isNaN
isPrototypeOf
length
Math
NaN
name
Number
Object
prototype
String
toString
undefined
valueOf
JavaScript is often used together with Java. You should avoid using some Java objects and properties as JavaScript identifiers:
getClass
java
JavaArray
javaClass
JavaObject
JavaPackage
JavaScript can be used as the programming language in many applications.
You should also avoid using the name of HTML and Window objects and properties:
alert
all
anchor
anchors
area
assign
blur
button
checkbox
clearInterval
clearTimeout
clientInformation
close
closed
confirm
constructor
crypto
decodeURI
decodeURIComponent
defaultStatus
document
element
elements
embed
embeds
encodeURI
encodeURIComponent
escape
event
fileUpload
focus
form
forms
frame
innerHeight
innerWidth
layer
layers
link
location
mimeTypes
navigate
navigator
frames
frameRate
hidden
history
image
images
offscreenBuffering
open
opener
option
outerHeight
outerWidth
packages
pageXOffset
pageYOffset
parent
parseFloat
parseInt
password
pkcs11
plugin
prompt
propertyIsEnum
radio
reset
screenX
screenY
scroll
secure
select
self
setInterval
setTimeout
status
submit
taint
text
textarea
top
unescape
untaint
window
In addition you should avoid using the name of all HTML event handlers.
Examples:
onblur
onclick
onerror
onfocus
onkeydown
onkeypress
onkeyup
onmouseover
onload
onmouseup
onmousedown
onsubmit
CONFIDENTIALITY / COPYRIGHT NOTICE: This site and my information and any attachments contains the PRIVILEGED AND CONFIDENTIAL INFORMATION of Fred Finkelstein & Irondesigner DBA / LLC mutually, Inc., its affiliated corporations or legal entities, and is intended only for the use of the individual(s) named above. If you are not the intended recipient of this e-mail or invited to this site, or the employee or agent responsible for delivering this to the intended recipient, you are hereby notified that any unlawful interception, dissemination, disclosure, printing or copying of this e-mail or site or any attachments is strictly prohibited under the Electronics Communication Privacy Act (ECPA), 18 USCA 2510, 18 USCA 2511, and any applicable laws. If you have received this e-mail or viewing this site in error, please delete or destroy it & close down, including all attachments or copies, and immediately notify us by e-mail at mechanicalengrg@gmail.com
EXAMPLE CODE & DISPLAY
<HTML>
<HEAD>
<TITLE>Longo Toyota</TITLE>
<SCRIPT LANGUAGE="Javascript">
<!--
if (document.images) {
var i;
var imgNameArray = ["longodiff","newvehicles","usedvehicles","finance",
"parts","service","collisionrepair","contactus",
"penske"];
var imgSubNavArray = ["home","paycal","prequal","qukquo"];
for (i = 0; i < imgNameArray.length; i++) {
eval(imgNameArray[i] + "_off = new Image();");
eval(imgNameArray[i] + "_off.src = 'images/nav_" +
imgNameArray[i] + ".gif';");
eval(imgNameArray[i] + "_on = new Image();");
eval(imgNameArray[i] + "_on.src = 'images/nav_" +
imgNameArray[i] + ".mo.gif';");
}
for (i = 0; i < imgSubNavArray.length; i++) {
eval("s_" + imgSubNavArray[i] + "_off = new Image();");
eval("s_" + imgSubNavArray[i] + "_off.src = 'images/subnav_" +
imgSubNavArray[i] + ".gif';");
eval("s_" + imgSubNavArray[i] + "_on = new Image();");
eval("s_" + imgSubNavArray[i] + "_on.src = 'images/subnav_" +
imgSubNavArray[i] + ".mo.gif';");
}
}
function imgOn(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "_on.src");
}
}
function imgOff(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "_off.src");
}
}
function jumpTo(selector) {
var other_sites = selector.options[selector.selectedIndex].value;
var penske_site = "http://www.penske.com/";
var toyota_site = "http://www.toyota.com/";
if (other_sites == penske_site) {
window.open(other_sites,"penskecom","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=1,width=800,height=600");
}
else if (other_sites == toyota_site) {
window.open(other_sites,"toyotacom","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=1,width=800,height=600");
}
else {
self.location.href = selector.options[selector.selectedIndex].value;
}
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#000000" LINK="#CC0000" VLINK="#CC0000"
LEFTMARGIN="0" TOPMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
<script language=javascript>
<!--
function checkNumber(input,calc) {
if(input.value == '') {
alert('This field requires numeric data');
input.value=input.defaultValue;
}
if(input.value > 9999999 || input.value < 0) {
alert('Value out of bounds');
input.value=input.defaultValue;
}
// status = '';
// msg = "This field requires numeric data: " + input.value;
var str = input.value;
if (isNaN(str)) {
var straray = str.split(',');
if (straray[1]) {
str = straray[0].concat(straray[1]);
}
if (straray[2]) {
str = str.concat(straray[2]);
}
if (str.substr(0, 1) == "$") {
str = str.substr(1, str.length);
}
if (str.substr((str.length - 1), str.length) == "%") {
str = str.substr(0, (str.length - 1));
}
input.value = str;
if(isNaN(input.value)) {
alert('This field requires numeric data');
input.value=input.defaultValue;
}
}
add_input(calc);
}
function add_input(calc) {
// alert("price:" + calc.price.value + " rate:" + calc.rate.value + " down_payment:" + calc.down_payment.value + " term:" + calc.term.value);
var total_cost;
total_cost = (calc.price.value * 1 - calc.down_payment.value);
var i = calc.rate.value;
if (i == 0) {
calc.payment.value = Math.round((total_cost) / (calc.term.value));
}
else {
i = i / 100.0;
i /= 12;
var pow = 1;
for (var j = 0; j < calc.term.value; j++) {
pow = pow * (1 + i);
}
calc.payment.value = Math.round((total_cost * pow * i) / (pow - 1));
}
return false;
}
function selectField(field) {
field.select()
}
//-->
</script>
<center>
<!---------- new layout ---------->
<form method=post action="/calculator.cgi" name="calc" onSubmit="return false;">
<input type=hidden value=1 name="initform">
<!-- top bar table starts -->
<br><br><br><br>
<table width=275 border=0 bgcolor="#6699CC" hspace=0>
<tr><td><center>
<strong><font size="4" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000">Monthly Payment Calculator</font></strong>
</td></tr>
</table>
<!-- top bar table ends -->
<!-- spacer table starts -->
<table height=3 cellpadding=0 cellspacing=0 border=0 hspace=0 vspace=0>
<tr><td></td></tr>
</table>
<!-- spacer table ends -->
<!-- middle outer table starts -->
<table width=275 border=0 cellpadding=10 cellspacing=2 bgcolor="#FFFFFF">
<tr><td>
<!-- middle inner table starts -->
<table>
<tr><td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000">Vehicle Price: </font></td>
<td align=right><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"> $</td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"> <input type=text size=8 name=price value="25240" onFocus="selectField(this)" onChange="checkNumber(this,calc)"></td>
</tr>
<tr><td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000">Interest Rate: </font></td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"> %</td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"> <input type=text size=8 name=rate value="9" onFocus="selectField(this)" onChange="checkNumber(this,calc)"></td>
</tr>
<tr><td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000">Down Payment: </font></td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"> $ </td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"> <input type=text size=8 name=down_payment value="0" onFocus="selectField(this)" onChange="checkNumber(this,calc)"></td>
</tr>
<tr><td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000">Term of Loan: </font></td>
<td> </td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"> <input type=text size=8 name=term value="48" onFocus="selectField(this)" onChange="checkNumber(this,calc)"></td>
</tr>
<tr><td></td>
<td></td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color=""> <input type=image value=" Calculate " src="enter_button.jpg" border=0 name="submit" onClick="add_input(calc);return false;"></font></td>
</tr>
<!--
<tr><td></td>
<td colspan=2>
</font></td>
</tr>
-->
</table>
<!-- middle inner table ends -->
</td></tr>
</table>
<!-- middle outer table ends -->
<!-- spacer table starts -->
<table height=3 cellpadding=0 cellspacing=0 border=0 hspace=0 vspace=0>
<tr><td></td></tr>
</table>
<!-- spacer table ends -->
<!-- bottom bar table starts -->
<table width=275 border=0 cellpadding=10 cellspacing=3 bgcolor="#6699CC" hspace=0>
<tr><td>
<!-- middle bottom bar table starts -->
<table>
<tr><td><b><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"><b>Monthly Payment: </b></font></b></td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"><b>$</b></td>
<td><font size="2" face="Geneva, Helvetica, Arial, Times, Sans-Serif" color="#000000"><input type=text size=8 name=payment value="628.10" size=8></td>
</tr>
</table>
<!-- middle bottom bar table ends -->
</td></tr>
</table>
</form>
</font>
</BODY>
</HTML>
<html>
<script>
function setfocus() {
document.calcform.x.focus();
}
function calc() {
x = document.calcform.x.value;
y = convert(x);
y = roundresult(y);
document.calcform.y.value = y;
}
function calctest() {
x = document.calcform.x.value;
y = convert(x);
//y = roundresult(y);
y = roundresult1(y);
document.calcform.y.value = y;
}
function calc3() {
x1 = document.calcform.x1.value;
x2 = document.calcform.x2.value;
y = convert(x1,x2);
y = roundresult(y);
document.calcform.y.value = y;
}
function calc4() {
x1 = document.calcform.x1.value;
x2 = document.calcform.x2.value;
x3 = document.calcform.x3.value;
y = convert(x1,x2,x3);
y = roundresult(y);
//yy = y.toString();
//if( yy.length>12 ) {
// y = parseFloat(y);
// y = y.toPrecision(10);
//}
document.calcform.y.value = y;
}
function calc5() {
x = document.calcform.x.value;
y = convert1(x);
y = roundresult(y);
document.calcform.y1.value = y;
y = convert2(x);
y = roundresult(y);
document.calcform.y2.value = y;
}
function str2num(s)
{
s=s.toString().trim().replace(/(\d)(\s+)(?=\d)/gm,"$1+").replace(/[^-()\d/*+.]/g, '');
if( s=='' ) return 0;
return Function('"use strict";return ('+s+')')();
}
function isInt(n)
{
return Number(n) === n && n % 1 === 0;
}
function isFloat(n)
{
return Number(n) === n && n % 1 !== 0;
}function roundresult(x) {
y = parseFloat(x);
y = roundnum(y,10);
return y;
}
function roundnum(x,p) {
var i;
var n=parseFloat(x);
var m=n.toPrecision(p+1);
var y=String(m);
i=y.indexOf('e');
if( i==-1 ) i=y.length;
j=y.indexOf('.');
if( i>j && j!=-1 )
{
while(i>0)
{
if(y.charAt(--i)=='0')
y = removeAt(y,i);
else
break;
}
if(y.charAt(i)=='.')
y = removeAt(y,i);
}
return y;
}
function removeAt(s,i) {
s = s.substring(0,i)+s.substring(i+1,s.length);
return s;
}
</script>
<h1>Fahrenheit to Celsius conversion</h1>
<form name="calcform" autocomplete="off">
<table class="calc2">
<tr>
<td><label for="x">Fahrenheit:</label></td>
<td><input type="text" id="x" name="x" class="intext" required autofocus></td>
<td class="mathsymbol">°F</td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<button type="button" title="Convert" class="btn" onclick="OnCalc()"><span>=</span> Convert</button>
<button type="reset" title="Reset" class="btn"><span>×</span> Reset</button>
</td>
</tr>
<tr>
<td>Celsius:</td>
<td><input type="text" id="y" class="outtext" readonly></td>
<td class="mathsymbol">°C</td>
</tr>
<tr id="pf1">
<td>Calculation:</td>
<td><textarea id="TA" rows="3" class="outtext" readonly></textarea></td>
<td> </td>
</tr>
</table>
</form>
<script src="../convert.js"></script>
<script>
var xelem=document.getElementById("x");
window.addEventListener("DOMContentLoaded",function() {
xelem.onkeypress = function(e) { if( e.keyCode==13 ) OnCalc(); };
var params=GetURLParams();
if( Object.keys(params).length>0 && params.x!="" ) {
document.title = params.x+" fahrenheit to celsius";
//SetLinks(params);
xelem.value = decodeURIComponent(params.x);
OnCalc();
}
});
function GetURLParams()
{
var url=window.location.href;
var regex = /[?&]([^=#]+)=([^&#]*)/g,
//url = "www.domain.com/?v=123&p=hello",
params = {},
match;
while(match = regex.exec(url)) {
params[match[1]] = match[2];
}
return params;
}
function OnCalc() {
var x = str2num(xelem.value);
var y = (x-32.0)*5.0/9.0;
var yy=roundresult(y);
var txt="("+x+"\u00B0F-32)\u00D75/9\n";
txt+="= "+yy+"\u00B0C";
document.getElementById("y").value = yy;
document.getElementById("TA").value = txt;
}
</script>
</html>
<!-- Unit Conversion Script - TheUnitConverter.com -->
<div style="width:238px;margin:0px auto;">
<div style="width:99.5%;border:
1px solid #2D6AB4;
border-top:none;
border-bottom:none;text-align:center;
height:24px;font-size:16px;padding:5px 0px 0px 0px;
border-top-right-radius:5px;
border-top-left-radius:5px;
background-color:#2D6AB4;
color:#FFFFFF;
font-weight:bold;">
<a href="https://www.theunitconverter.com/" style="color:#FFFFFF;
text-decoration:none;
" rel="nofollow">
Length Conversion</a>
</div>
<script type="text/javascript" src="https://www.theunitconverter.com/converter.php?l=en&t=1&c=0&a=FFFFFF&d=000000&b=2D6AB4&s=length">
</script>
</div>
<!-- End of Unit Conversion Script -->