myjavawork

Quite unlucky today: JS compression occurs when a syntax error, which led me to lookdesperately wrong

If the error in two ways: 1. missing semicolon 2. variables and function names error

 

In fact, the actual development process uncompressed code can run. JS statementbecause the end is the end of the line and the semicolon

If the code is not standardized, there will be problems.


Therefore, there is no problem for the future compression, in the preparation of their owncode, to comply with the following specifications

1.function initForm() { function与函数名之间留一个空格
2. 任何语句块一定要以 "分号" 结束,上面就是因为在对象的定义后没有加上分号造成了错误。

var pageObj
= {

};
一定要加分号,因为这里自己是非常容易忽视的。


HTML的压缩规范
HTML compression, there have been mistakes, because the same reasons that causednon-standard, so
1.Do not have extra spaces, especially text
2.Between the attributes tag, only to be separated by a space

<input    type= "button" />
未压缩时没有错误,压缩时会出现错误。

标准:
<input type="button" /> 只能留一个空格。

分类:

技术点:

相关文章: