Skip to main content
Participant
November 7, 2023
Question

letで変数を宣言するとシンタックスエラーとなる

  • November 7, 2023
  • 1 reply
  • 317 views

Dreamweaver2021を使用しています。

 

外部業者がコーディングしたファイルの微調整を行っているのですが、JavaScript部分で、「let」で変数を定義している行がシンタックスエラー有となっています。

 

let を var に書き換えるとエラー文は消えますが、膨大な数使用されているので、すべての置換は考えられません。

「サイト設定」→「詳細設定」→「JS構文チェック」は、ECMAScript var:6となっています。

 

構成ファイルの書き換えなどで、この「let」によるシンタックスエラーは解消できるでしょうか?

This topic has been closed for replies.

1 reply

Omachi
Legend
November 7, 2023

自分ではやってみていないんだけど、次のディスカッションが参考になるかしら。

https://community.adobe.com/t5/dreamweaver-discussions/javascript-variables-don-t-work-for-me/td-p/11214896

この中の下の方、2023/09/18の返信です。

 

1. Go to Site > Manage Sites and click the site you are working on to highlight it
2. Hit Edit (pencil icon)
3. Click Advanced Settings to expand the menu
4. Click JS Lint at the bottom
5. Click the Edit Configuration File button and add the following to the top of the file...

 

{

    "parserOptions": {

        "ecmaVersion": "latest",

    },

    "env": {

        "es6": true

    }

}

5. Save and close the document (it may be necessary to restart DW as well). 

 

英語に堪能ではないので読み違えてたらすみません。