JavaScript 复习笔记

今天又从头开始看JavaScript红宝书,这一次本着更加细致的原则,从头去再刷一遍,另外犀牛书也可以开始看了。

HTML中的JS元素

1
<script src = “test.js” />

不符合规范,所以在平时写作时候,尽量保持良好的书写规范。

1
<noscript>
1
2
3
4
5
6
7
8
var S1 = "01" //+S1 = 1 -S1 = -1
var S2 = "1.1" //+S2 = 1.1 -S2 = -1.1
var S3 = "z" //+S3 = NaN -S3 = NaN
var S4 = "false" //+s4 = 0 -S4 = 0
var S5 = {
valueOf:function(){
return -1;
}}; //+S5 = -1 -S5 = 1
1
2
"55" == 55; //true
"55" === 55; //false 因为是不同类型的
1
2
3
4
5
with(location){
var qs = search.substring(1); //location.search.substring(1)
var hostName = hostname;
var url = href:
}
script>