当前位置: 首页 > 图文教程 > 网络编程 > Javascript > JavaScript 指导方针

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 JavaScript 指导方针


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 109 ::
收藏到网摘: n/a

本节的内容是:在使用JavaScript进行编码的过程中,其他一些需要了解的重要事项。
JavaScript对大小写敏感
名为"myfunction"的函数和名为"myFunction"的函数是两个不同的函数,同样,变量"myVar"和变量"myvar"也是不同的。
JavaScript对大小写敏感 - 所以当你创建或使用变量、对象及函数时,请注意字符的大小写。
空格
JavaScript会忽略多余的空格。所以你可以在代码中添加适当的空格,使得代码的可读性更强。下面的两行是等效的:
name="Hege"
name = "Hege"换行
你可以在字符串内部使用反斜杠对代码进行折行。下面的例子是正确的:
document.write("Hello \
World!")但是不能像这样折行:
document.write \
("Hello World!")注释:
你可以使用两个斜杠来添加注释:
//this is a comment
document.write("Hello World!")也可以使用/*和*/:(这样可以创建多行的注释块)
/* This is a comment
block. It contains
several lines */
document.write("Hello World!")