2017-07-05 22 views
0

所以我做了一個簡單的蝕刻一個素描,這似乎是工作Codepen:我想https://codepen.io/Chango-/pen/GEBpbx製造蝕刻一個草圖,工程上的jsfiddle但不是在Github頁面

<head> 
    <title>Etch-a-Sketch</title> 
    <link rel="stylesheet" href="stylesheet.css"></link> 
    <!-- Latest compiled and minified CSS --> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 
    <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"> 

</head> 

<body> 
    <h4>The Greatest Etch-A-Sketch in the Universe</h4> 

    <center> 
    <button class="newGrid btn btn-primary" type="button">New sketch!</button> 
    <button class="randomColor btn btn-primary">Random Color</button> 
    </center> 


    <div id="container"></div> 

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
</body> 

在Github上部署靜態網站,但即使腳本包含在HTML文件中,JQuery似乎也不工作。不知道是什麼問題

鏈接到GitHub庫:https://github.com/CGrijalva90/etch-a-sketch

鏈接到Github的頁面:https://cgrijalva90.github.io/etch-a-sketch/

+1

是啊...你的github.io頁面加載jQuery,很好的開始,但絕對沒有其他的JavaScript加載 - 即你沒有加載頁面 –

+0

Grrrr頁面中的EtchaSketch.js ...是的,CSS在檢查網站時似乎不起作用。不知道爲什麼js文件沒有加載。我讓主分支成爲頁面的源代碼。 – user7496931

+0

'不知道js文件爲什麼不加載 - 好吧,首先,html中沒有腳本標記 –

回答

1

script標籤添加到您的HTML

<script src="./EtchaSketch.js"></script> 

而且修正CSS標籤在你的頭部右側href

<link rel="stylesheet" href="./EtchaSketch.css"> 
相關問題