JavaScript语法基础;目的;;什么是JavaScript3-2;什么是JavaScript;将JavaScript嵌入网页;使用Script标签;使用外部JS文件;使用外部JS文件;变量;申明变量;申明变量;;;数据类型;HTML
HEAD
SCRIPTLANGUAGE=JavaScript
varx=100;
vary;
varz;
document.write(H2竞拍SONY数码相机600万像素+x+$起价/H2);
y=prompt(加多少银子?,1);
z=x+y;
alert(您最终旳出价\n+z+$);//”\n”用于换行显示
/SCRIPT
/HEAD
body
/body
/HTML;HTML
HEAD
SCRIPTLANGUAGE=JavaScript
varx=100;
vary;
varz;
document.write(H2竞拍SONY数码相机600万像素+x+$起价/H2);
y=prompt(加多少银子?,1);
z=x+parseFloat(y);
alert(您最终旳出价\n+z+$);//”\n”用于换行显示
/SCRIPT
/HEAD
body
/body
/HTML;运算符;运算符;算术运算符-1;HEAD
SCRIPTlanguage=JavaScript
functioncalcu()
{
varnumb1=document.calc.num1.value;
varnumb2=document.calc.num2.value;
vartotal=parseFloat(numb1)*parseFloat(numb2);
document.calc.result.value=total;
}
/SCRIPT
/HEAD;比较运算符;HTML
HEAD
SCRIPTLANGUAGE=JavaScript
functioncalcu()
{
varnumb1=document.calc.num1.value;
varnumb2=document.calc.num2.value;
vartotal=parseFloat(numb1)*parseFloat(numb2);
document.calc.result.value=total;
if(total500)
alert(购置总价超出500\n支付时将赠予超级Q币2枚!);
}
/SCRIPT
/HEAD
….其他代码略,同上例;运算符;HEAD
SCRIPTLANGUAGE=JavaScript
functioncalcu()
{
varnumb1=document.calc.num1.value;
varnumb2=document.calc.num2.value;
vartotal=parseFloat(numb1)*parseFloat(numb2);
document.calc.result.value=total;
if((total500)(total=1000))
alert(购置总价超出500\n支付时将赠予超级Q币2枚!);
if((total1000)(total=2023))
alert(购置总价超出1000\n支付时将赠予IBM光电智能鼠标1只!);
if((total2023))
alert(购置总价超出2023\n请直接与来宾台联络!);
}
/SCRIPT
/HEAD….其他代码略,同上例;;HEAD
SCRIPTLANGUAGE=JavaScript
functioncalcu()
{
varnumb1=document.calc.num1.value;
varnumb2=document.calc.num2.value;
if((numb1!=)(numb2!=))
{
vartotal=parseFloat(numb1)*parseFloat(numb2);
document.calc.result.value=total;
if((total500)(total=1000))
alert(购置总价超出500\n支付时将赠予超级Q币2枚!);
if((total1000)(total=2023))
alert(购置总价超出1000\n支付时将赠予IBM光电智能鼠标1只!);
if((total2023))
alert(购置总价超出2023\n请直接与来宾台联络!);
}
}
/SCRIPT
/HEAD….其他代码略,同上例;ifelse