V
V
Vyacheslav Lebedev2015-03-01 12:06:59
JavaScript
Vyacheslav Lebedev, 2015-03-01 12:06:59

Why isn't jQuery syntax highlighting correct in WebStorm?

Good afternoon! :)
Here's the code, my webstorm (linux) underlines like unresolved function(together with $):
$(document).ready()
And much more...
What can I do to make everything display properly?)))

And yet, when specifying image paths in sass, underlines red and writes: cannot resolve file
How to get rid of this? And is there a plugin for auto-substitution of paths?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2015-03-01
@slavikse

For webstorm to understand jquery, you need to specify it as an external library:
Settings > Languages ​​and Frameworks > JavaScript > Libraries > Download... > Typescript comunnity stubs
blog.jetbrains.com/webstorm/2014/07/how-webstorm-w...
In order to be able to use absolute paths from a folder in the project (for example, public), you need to mark it as Resource root.
Right click > Mark directory as > Resource root
https://www.jetbrains.com/webstorm/help/configurin...

A
Alexander Tsymbal, 2015-03-01
@AlexanderTsymbal

1. check how many times you have jQuery included (should be no more than once),
2. check if any other libraries are included that might reserve $. Include jquery scripts using the construct:

jQuery(document).ready(function($){
//здесь уже спокойно пишем всё через $
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question