易截截图软件、单文件、免安装、纯绿色、仅160KB

Javascript网页计算器

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>网页计算器</title>
<style type="text/css">
#container
{
width: 432px;
margin: 0 auto;
text-align: center;
height: 324px;
}
div
{
text-align: left;
width: 400px;
}
input
{
height: 37px;
width: 93px;
margin-bottom: 10px;
background: #CA0;
font-size: 30px;
}
input#answer
{
height: 37px;
width: 381px;
color: #FFF;
font-size: 35px;
text-align: right;
background: #38B;
}
input#equ
{
height: 37px;
width: 190px;
}
input#rst
{
height: 37px;
width: 190px;
}
</style>
<script language="javascript" type="text/javascript">
// 错误处理
window.onerror = function killerr() {
return true;
}
// 计算所需的两个因数
var param1, param2;
// 计算结果
var answer;
// 运算符
var oprt;
// 因数标记
var flag;
// 计算参数分配函数
function doCalc(val) {
if (document.getElementById("answer").getAttribute("value") == "ERROR" && val != "CE") {
// 计算器出错时提示,并终止操作
alert("Please reset calculator");
return false;
}
switch (val) {
// 操作符
case "+":
case "-":


相关文档:

JavaScript 屏蔽右键

1、function vv()
    {
        if(event.button==2)
        {
            alert('防止服务器负担过大,右键功能被屏蔽!')
       ......

调用JavaScript文件

调用JavaScript文件
用作导航栏
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ......

javascript读取xml实现应用程序菜单效果

/*样式*/
<style type="text/css">
    td{font-size:12px;}
    .item{text-decoration:none;width:100%;height:100%; line-height:22px;cursor:default;color:Black;vertical-align:middle}
    .staticTab{cursor:default;height:22px}
   ......

javascript prototype

 
下面都是个人理解以及查找的网上的资料,如有不对的地方请指正
prototype
prototype在这里是原型的意思,不是指那个框架...
每个函数就是一个对象(Function),当函数被解析后会添加一个prototype的对象,然后prototype会添加一个constructor的属性
它指向那个函数的
比如定义一个function test(){}
它会 ......

JavaScript基本属性方法参考


JavaScript基本属性方法参考
document.body.scrollTop  返回和设置当前竖向滚动条的坐标值,须与函数配合,
document.body.scrollLeft  返回和设置当前横向滚动务的坐标值,须与函数配合,
window.status=defaultStatus  将状态栏设置默认显示
Obejct.innerHTML 对象Object标签中的html源代码
Ob ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号