2016-10-20 17 views
-1
<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のエラーメッセージとコードのスクリーンショット</p> <p><a href="https://i.stack.imgur.com/IseMU.png" rel="nofollow"><img src="https://i.stack.imgur.com/IseMU.png" alt="."></a></p> <p>あるDreamweaverで明らかな理由で

私はjavascriptの初心者ですので、このコードは面倒です。

+2

あなたは配列の要素の間にカンマを( '')忘れてしまいました。 – tektiv

+1

また、 'changeLight'から関数を呼び出すこともありません。そして、あなたが呼び出そうとしている「関数」の2つは存在しないようですか? –

+0

@JoachimPileborg関数呼び出しはボタン上にありますが、何もしない関数と2つの関数が呼び出されているようです。 – Pete

答えて

0

これは次のようになります。

<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> 
+0

ありがとう、私はそれがJSを知っている誰にでも痛いほど明白かもしれないと思った。 –

関連する問題

 関連する問題