我在 Dreamweaver 中收到没有明显原因的语法错误
I am being given a syntax error with no obvious reason in dreamweaver
<script>
function changeLight(){
lightOne
lightTwo
lightThree
}
function lightOne(){
}
var list1=[
"../../../Pictures/lights/red.png"
"../../../Pictures/lights/red.png"
"../../../Pictures/lights/red.png"
"../../../Pictures/lights/red.png"
"../../../Pictures/lights/lit red.png"
]
var list2=[
"../../../Pictures/lights/orange.png"
"../../../Pictures/lights/lit orange.png"
"../../../Pictures/lights/orange.png"
"../../../Pictures/lights/lit orange.png"
"../../../Pictures/lights/lit orange.png"
]
var list3=[
"../../../Pictures/lights/green.png"
"../../../Pictures/lights/green.png"
"../../../Pictures/lights/lit green.png"
"../../../Pictures/lights/green.png"
"../../../Pictures/lights/green.png"
]
</script>
这是dreamweaver中错误信息和代码的截图
我看不出这行有任何错误的原因,因为它没有在上面的行中发现错误。
我是javascript的初学者,所以这段代码很乱。
这应该是:
<script>
function changeLight(){
lightOne();
// lightTwo();
// lightThree();
}
function lightOne(){
}
var list1=[
"../../../Pictures/lights/red.png",
"../../../Pictures/lights/red.png",
"../../../Pictures/lights/red.png",
"../../../Pictures/lights/red.png",
"../../../Pictures/lights/lit red.png"
];
var list2=[
"../../../Pictures/lights/orange.png",
"../../../Pictures/lights/lit orange.png",
"../../../Pictures/lights/orange.png",
"../../../Pictures/lights/lit orange.png",
"../../../Pictures/lights/lit orange.png"
];
var list3=[
"../../../Pictures/lights/green.png",
"../../../Pictures/lights/green.png",
"../../../Pictures/lights/lit green.png",
"../../../Pictures/lights/green.png",
"../../../Pictures/lights/green.png"
];
</script>
<script>
function changeLight(){
lightOne
lightTwo
lightThree
}
function lightOne(){
}
var list1=[
"../../../Pictures/lights/red.png"
"../../../Pictures/lights/red.png"
"../../../Pictures/lights/red.png"
"../../../Pictures/lights/red.png"
"../../../Pictures/lights/lit red.png"
]
var list2=[
"../../../Pictures/lights/orange.png"
"../../../Pictures/lights/lit orange.png"
"../../../Pictures/lights/orange.png"
"../../../Pictures/lights/lit orange.png"
"../../../Pictures/lights/lit orange.png"
]
var list3=[
"../../../Pictures/lights/green.png"
"../../../Pictures/lights/green.png"
"../../../Pictures/lights/lit green.png"
"../../../Pictures/lights/green.png"
"../../../Pictures/lights/green.png"
]
</script>
这是dreamweaver中错误信息和代码的截图
我看不出这行有任何错误的原因,因为它没有在上面的行中发现错误。
我是javascript的初学者,所以这段代码很乱。
这应该是:
<script>
function changeLight(){
lightOne();
// lightTwo();
// lightThree();
}
function lightOne(){
}
var list1=[
"../../../Pictures/lights/red.png",
"../../../Pictures/lights/red.png",
"../../../Pictures/lights/red.png",
"../../../Pictures/lights/red.png",
"../../../Pictures/lights/lit red.png"
];
var list2=[
"../../../Pictures/lights/orange.png",
"../../../Pictures/lights/lit orange.png",
"../../../Pictures/lights/orange.png",
"../../../Pictures/lights/lit orange.png",
"../../../Pictures/lights/lit orange.png"
];
var list3=[
"../../../Pictures/lights/green.png",
"../../../Pictures/lights/green.png",
"../../../Pictures/lights/lit green.png",
"../../../Pictures/lights/green.png",
"../../../Pictures/lights/green.png"
];
</script>