I'm not very familiar with JavaScript. I want to use the chessboard.js library, but the rendered chessboard does not display the pieces (just the board). I did exactly the same thing as recommended here: How do I use chessboard.js , a javascript chessboard?
My code looks like:
<html>
<head>
<title>Test chessboard.js</title>
<link rel="stylesheet" href="chessboardjs-1.0.0/css/chessboard-1.0.0.css">
</head>
<body>
<div id="myBoard" style="width: 400px"></div>
<script src="jquery-3.6.3/jquery-3.6.3.js"></script>
<script src="chessboardjs-1.0.0/js/chessboard-1.0.0.js"></script>
<script>
var ruyLopez = 'r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R'
var board = Chessboard('myBoard', ruyLopez)
</script>
</body>
</html>
What am I doing wrong?
You needs to copy chess pieces in your local.
From
To your local
Then this example HTML can see the peases Due to all pieces img
src
linked related locationExample
Start Example HTML
I running with Live Server which HTML local server extension in VS code.
You can find all of example in here
here
here