Skip to main content
alices74118196
Participant
Dec 4, 2017 2:35 PM UTC
Question

Jquery Error Code: missing "use strict" statement and expected === and saw ==

I am trying to use Jquery to create click function on a menu.

using the google cdn library.

The jQuery is not working and shows the following errors:

firstly here is the source code that shows the google library.

This is the error showing in my "scripts.js" file

And in the jQuery.min.js file this error is showing

This topic is closed to new replies. Start a new post to keep the conversation going.

11 replies

Participant
Sep 13, 2020 10:35 AM UTC

problem fixed here : https://youtu.be/khmBtMlST9Q

Translate
B i r n o u
Legend
Dec 4, 2017 2:51 PM UTC

well there multiple way to answer... so

1 - concerning the error... the strict use of JS is nothing else than invoquing the strict mode either from the global script either from each function

to invoque the stric usage simply add as a first line

'use strict'

you can learn more there

Strict mode - JavaScript | MDN

2 - now concerning both error 'strict' and strictly equal... concerning jquery... never mind anbd live with...

any way you can get read of those statement by going on DW preferences category Linting

select JS and then edit... you can now edit

line 21 and replace by

"strict"        :false,  

and line 6

 "eqeqeq"        : false, 
Translate
B i r n o u
Legend
Dec 4, 2017 2:54 PM UTC

and last you didn't tell us what is not working in your script...

1 - first you could send us the script and tell what's not working

2 - as you use jquery... probably you will use it in your script... so it will recommand to swap line 7 and 8... load jquery before using it

Translate
alices74118196
Participant
Dec 4, 2017 4:01 PM UTC

Thank you for your help; I have edited the listing as advised which has helped with the "use strict" error, but has incidentally caused many more errors in the jquery.min.js:

I have also changed the lines 7&8 over in source code.

In the browser (google chrome) preview the click function on my hamburger menu is not working, it is supposed to reveal the menu when clicked.

Source Code

Jquery (click function doesn't work in preview)

     Stylesheet showing the .expand class.

I am hoping this shows enough information.

Thank you so much for helping.

Much appreciated.

Translate
BenPleysier
Community Expert
Community Expert
Dec 4, 2017 2:49 PM UTC

I wouldn't worry about the so-called errors yet.

Have a look at JavaScript "use strict" and  Strict mode - JavaScript | MDN

The errors in the code do not contribute to your function(s) not working, it must be something else in your code. Without seeing your full code, I cannot help any further.

Translate
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
pziecina
Legend
Dec 4, 2017 2:45 PM UTC

Ignore them, or go into preferences and turn off linting.

Dw's linting option is an all or nothing selection, and gives a number of false errors across all documents that it supports.

Translate