chess.js 和 chessboard.js 集成

huangapple go评论89阅读模式
英文:

chess.js and chessboard.js integration

问题

以下是翻译好的部分:

"Uncaught SyntaxError: Unexpected token 'export' (at chess.js:252:1)"
这一行是:
export const BLACK = 'b'

英文:

I need to use chess.js and chessboard.js but some errors occour on console.

My code is:

<script src="https://cdnjs.cloudflare.com/ajax/libs/chess.js/0.13.4/chess.js" integrity="sha512-40VRp1+fauX7g61ZdQpOiOJTkBbYwVlTLjCXHK9Svf0Mmz9K8Smg5k6LVrc0eEc9+pApf1HNL6Cim/wFqZeRkw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chessboard-js/1.0.0/chessboard-1.0.0.min.js" integrity="sha512-WfASs5HtTgTL/eZsLaOftSN9wMQl7WZGlU5UiKx/yxTViMfGh9whWRwKAC27qH8VtZJqSMqDdbq2uUb1tY3jvQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

and the error:

Uncaught SyntaxError: Unexpected token 'export' (at chess.js:252:1)

The line is:

export const BLACK = 'b'

答案1

得分: 0

solved using version 0.12.1

<script src="https://cdnjs.cloudflare.com/ajax/libs/chess.js/0.12.1/chess.min.js" integrity="sha512-rIescAjPgXHz3WaxrSjaOl5iZfvBVIehYe+EF+d+DAdFNgV10QBT8d5APBjcGFKES0iVUYjBilvpck7gOe7CLg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
英文:

solved using version 0.12.1

<script src="https://cdnjs.cloudflare.com/ajax/libs/chess.js/0.12.1/chess.min.js" integrity="sha512-rIescAjPgXHz3WaxrSjaOl5iZfvBVIehYe+EF+d+DAdFNgV10QBT8d5APBjcGFKES0iVUYjBilvpck7gOe7CLg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

huangapple
  • 本文由 发表于 2023年2月14日 01:09:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75439069.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定