最新在线看的黄网|伊人久久久久久久网站|日本a视频专区二|欧美A级无码毛片|有扫五av在线播放|好屌日aV在线播放|内射福利视频导航|极品少妇一区二区视频|无吗在线一区播放|性爱黄色视频不卡

深圳網(wǎng)站建設公司,網(wǎng)商在線LOGO

您的位置:首頁 > 新聞

codepen怎么保存,如何從Codepen獲取代碼
新聞 2023-03-17編輯:深圳網(wǎng)站建設閱讀(標簽: codepen

問題描述

如何從codepen中獲取代碼,并在我的文本編輯器中編輯保存?

How do I take the code from codepen, and use it locally in my text-editor?

http://codepen.io/mfields/pen/BhILt

我想在本地創(chuàng)建一個播放,但是當我用chrome打開它時,我得到一個空白的白頁,沒有任何東西。

I am trying to have a play with this creation locally, but when I open it in chrome, I get a blank white page with nothing going on.

<!DOCTYPE HTML>
<html>
<head>
<script> src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="celtic.js"></script>
<link rel="stylesheet" type="text/css"  src="celtic.css"></link>
</head>
<body>
<canvas id="animation" width="400" height="400"></canvas>
</body>
</html> 

我有復制,粘貼和保存css和js到不同的文件并保存,然后嘗試將它們鏈接到html文件,如上所示。

I have copy, pasted and saved the css and js into different files and saved them, then tried to link them into the html file as I have shown above.

我還包括jquery庫,因為我理解很多codepen創(chuàng)作使用它。

I have also included the jquery library as I understand a lot of the codepen creations use it.

我得到的唯一的控制臺錯誤是

The only console error I'm getting is

Uncaught TypeError: Cannot read property 'getContext' of null 

鏈接到我的js文件第4行

which is linking to my js file, line 4

(function(){

var canvas = document.getElementById( 'animation' ),
    c = canvas.getContext( '2d' ), 

對不起,如果這是愚蠢的, 。我相信這是基本的,任何幫助將是真棒!

Sorry if this is dumb, but I'm new to all this. I'm sure this is basic as hell. Any help would be awesome!

推薦答案

Joe Fitter是正確的,但我認為最好導出您的筆(使用導出導出.zip選項在本地使用筆)。這將給你一個工作版本的筆,而不必復制和粘貼CSS,JavaScript和HTML代碼,而不必對其進行更改,使其工作。

Joe Fitter is right, but I think is better to export your pen (use the export to export.zip option for using your pen locally). This will give you a working version of your pen without having to copy and paste the CSS, JavaScript and HTML code and without having to make changes on it for making it work.


相似內容
企業(yè)網(wǎng)站定制

企業(yè)網(wǎng)站定制 根據(jù)企業(yè)需求,量身定制設計

企業(yè)網(wǎng)站定制:2800元起
添加微信 請說明來意
聯(lián)系我們
站內搜索

24小時服務熱線 0755-29765948
  • 地址:深圳市羅湖區(qū)人民北路2033號206
  • 電話:0755-29765948 傳真:82256610
  • 手機:13714666846 18948334877
  • 郵箱:gong@ew35.com 164761418@qq.com
  • 粵ICP備14049207號
創(chuàng)意化數(shù)字品牌整合網(wǎng)絡營銷
營銷網(wǎng)站讓你坐等商機坐傭客戶,Rss

版權所有:深圳市網(wǎng)商在線科技有限公司

友情鏈接: