Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

DreamWeaver Unaware of Previously Declared Global Variables in JS

Community Beginner ,
Jul 08, 2020 Jul 08, 2020

Hello,

I have a website we're building that has to use one PHP file to declare and set the values of some global JS variables.  Then in anotehr JS file we have to take actions based on the values in those global variables. However, in DreamWeaver the JS file is full of false-positive error messages for "undeclared variable" with regard to all those global JS variables ( that were declared and given values in the previous PHP file ).

 

Of course, everything works properly when we test our logic in a web browser.  But it's now hard to debug this long JS file, because we have to constantly hover over, see and then disregard 90% of the error lines - as they are false positive - in order to finally arrive at and fix any REAL errors when we add or update the logic.

 

Does anybody know a way around this?  Making DreamWeaver properly aware of previously declared global variables between multiple files?

 

Thank You

212
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 08, 2020 Jul 08, 2020

Hi,

 

These errors could be due to the linting rules configured for the site. Please try to configure JS linting rules as per your requirement by performing the below.

 

Steps:
1. Open site setup dialogue of the site for which you want to configure js linting.
2. Go to Advanced Settings > JS Lint.
3. You can then choose Ecmascript version of your choice or have a configuration file.
4. If you are using configuration file option then clicking on edit configuration file option will open up an eslintrc file in your site root.
5. You can edit the rules in the eslintrc file.

You may want to look at https://eslint.org/docs/user-guide/configuring#specifying-environments for defining other environments for the site if needed.


For more details on eslint rules please refer to below links:
1. https://eslint.org/docs/rules/

2. https://helpx.adobe.com/in/dreamweaver/using/linting-code.html

3. https://www.linkedin.com/learning/dreamweaver-cc-new-features/set-javascript-linting-preferences?u=2...

 

Please let us know if you still face the issue.

 

Thanks,
Nayan
Dreamweaver Team

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 09, 2020 Jul 09, 2020
LATEST

Are you using a local testing server to parse the PHP includes?  Without a server the PHP includes and the codes contained inside them don't exist. 

 

OPTION 1: Trust your code, ignore the errors.

 

OPTION 2: Set-up a local testing server.  See this related discussion for details.

https://community.adobe.com/t5/dreamweaver/msetup-dreamweaver-for-localhost-without-a-remote-host/td...

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines