|
Project Information
Members
Featured
Downloads
Links
|
Latest News6 Jun 2010 jsChessboard 0.2.0 has been released. Download here. 18 Mar 2009 jsChessboard 0.1.0 has been released. Download here. What is jsChessboard ?jsChessboard is a JavaScript library designed to programmatically display chessboard diagrams in web pages or web applications. jsChessboard knows chess notation therefore jsChessboard can interpret a sequence of chess moves in algebraic notation from a given position and draw the new position. Supported browsersMost browsers supporting the <canvas> HTML tag are supported by jsChessboard.
DemoGetting startedPreparing the HTMLAdd the script headers for jsChessboard to work. <script type="text/javascript" src="chessboard.js"></script> Then add a <canvas> where you want the chessboard diagram to appear. Note that the canvas element width and height must have the same value. <canvas id="myboard" width="300" height="300"></canvas> JavaScriptAdd this inline script in your web page <script type="text/javascript">
function showBoard() {
game = Chessboard.newGame();
game.move("e4, Nf6");
game.draw("myboard");
}
</script> And call this script on page load. <body onload="showBoard();"> The result should look like that:
|