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

JavaScript 基础技巧(1)

1:基础知识
1 创建脚本块
<script language=”JavaScript”>
        JavaScript code goes here
</script>
2 隐藏脚本代码
1: <script language=”JavaScript”>
2: <!--
3: document.write(“Hello”);
4: // -->
5: </script>
在不支持JavaScript的浏览器中将不执行相关代码
3 浏览器不支持的时候显示
1: <noscript>
2: Hello to the non-JavaScript browser.
3: </noscript>
4 链接外部脚本文件
1: <script language=”JavaScript” src="/”filename.js"”></script>
5 注释脚本
1: // This is a comment
2: document.write(“Hello”); // This is a comment
3: /*
4: All of this
5: is a comment
6: */
6 输出到浏览器
1: document.write(“<strong>Hello</strong>”);
7 定义变量
1: var myVariable 
oman';">= “some value”;
8 字符串相加
1: var myString = “String1” + “String2”;
9 字符串搜索
1: <script language=”JavaScript”>
2: <!--
3: var myVariable = “Hello there”;
4: var therePlace = myVariable.search(“there”);
5: document.write(therePlace);
6: // -->
7: </script>
10 字符串替换
1: thisVar.replace(“Monday”,”Friday”);
11 格式化字串
1: <script language=”JavaScript”>
2: <!--
3: var myVariable = “Hello there”;
4: document.write(myVariable.big() + “<br/>”);
5: document.write(myVariable.blink() + “<br/>”);
6: document.write(myVariable.bold() + “<br/>”);
7: document.write(myVariable.fixed() + “<br


相关文档:

javascript table操作类

/************** javascript table操作类***************
* 仅适合IE6
****调用示例*****************************************
*
* var table=new TableOption("tb");
*
* var table=new TableOptions("tb",{hoverColor:#aabbcc,hover:false});
*
*****************************************************/
var $= ......

Javascript判断空格

正则
<script>
 function checkvalue(){
 if(document.Form.content.value.replace(/\s/g,"")=="")
 {
 alert("内容不能为空!");
 document.addForm.content.focus();
 return false;
 }
 document.addForm.submit();
 return ......

javascript的document对象详解(转)

document 文挡对象 - JavaScript脚本语言描述
---------------------------------------------------------------------
注:页面上元素name属性和JavaScript引用的名称必须一致包括大小写
   否则会提示你一个错误信息 "引用的元素为空或者不是对象"
------------------------------------------------------ ......

c# cookie的使用,以及与javascript cookie的交互

C#:
创建:
    HttpCookie cookie = new HttpCookie("regID");
            cookie .Value = username;
            cookie .Expires = DateTime.Now.AddDays(1);
  & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号