问:我的播放列表没有加载,并且仔细查看了我的代码后,没有发现任何异常。有人看到我没看到的东西吗?非常感谢你!
var playList = [];
playList 。推送('I Did It It My Way' ); playList 。推送('Respect' ,'Imagine' ); playList 。不移位('Born to Run' ); playList 。不变('Louie,Louie' ,'Maybellene' ); printList (playList );
函数 printList ( list ) {
var listHTML = '<ol>' ; 为(VAR我= 0 ;我<列表。长度;我+ = 1 ){ listHTML + = '<LI>' +列表[我] + '</ LI>' ; } listHTML + = '</ ol>' ; 打印(listHTML ); }函数打印(
html ) {
文档。写(html ); }
<!DOCTYPE html>
< html lang = “ zh-cn” >
<头>
< meta charset = “ UTF-8” > <标题>音乐播放列表</标题> < link rel = “ stylesheet” href = “ css / styles.css “ > </头> <身体> < h1 >我的音乐播放列表</ h1 > <div id = “ listDiv” >
</ div >
< script src = “ js / helpers.js” > </ script > < script src = “ js / playlist.js” > </ scrip> </ body > </ html
答:似乎您的结束脚本标记中有错字playlist.js。您错过了“ t”。:)