javascript - HTML, calling JS (API) -


i have few issues calling chessboard.js (http://chessboardjs.com). downloaded api , made new html file:

<!doctype html> <html> <head>   <title>super chess/title>   <meta charset="utf-8"/>   <script src=":\path-to-js-file\jschessboard-0.3.0.js"></script> </head> <body bgcolor="lightgrey"> <div id="board" style="width: 400px"></div> <script> var board = new chessboard('board', 'start'); </script> </body> </html> 

i tried draw chessboard. i'm doing wrong? thanks.

from can tell based on code , docs, you're missing 2 things:

1) title tag isn't closed on line 4 of html file

2) after you've fixed problem you'll error saying "$ isn't defined" in chessboard.js file. teased out jquery dependency chessboard.js file. if include jquery in html (either download file you've done chessboard.js or use cdn).

you should after that!!


Comments

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -