phpstorm无法解析的函数或方法

phpstorm无法解析的函数或方法

本文介绍了phpstorm无法解析的函数或方法$()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:phpstorm无法识别jquery方法,到处都是

I have the following problem: phpstorm do not recognize jquery methods and here and there I see

这困扰了我一段时间,但最终我尝试通过 File-> Settings-> JavaScript-> Libraries 摆脱它,并将jquery添加为global/project.

This was bugging me for sometime but finally I tried to get rid of it with File->Settings->JavaScript->Libraries and adding jquery as a global / project.

我的媒体库设置如下:

My library setup looks like this:

但是没有改变任何东西.我仍然看到那些讨厌的通知.有谁知道如何摆脱它们?

But is has not changed anything. I still see those pesky notices. Does anyone know how to get rid of them?

推荐答案

有一个非常愚蠢的解决方法,

There is a really stupid workaround,

从IDE本身内部下载库(在本例中为 jQuery ).

Download the Library (in this case jQuery) from inside the IDE itself.

  • 打开设置(在Linux上为 Ctrl + Alt + S )
  • 导航到语言和框架-> JavaScript ->
  • 点击下载,然后选择 jQuery
  • Open up settings (Ctrl + Alt + S on Linux)
  • Navigate to Languages & Frameworks -> Javascript -> Libraries
  • Click Download and choose jQuery

希望错误会消失

欢呼

通过 Fiddler 运行IDE后,我意识到这只能解决问题,因为IDE会下载版本.

After running the IDE through Fiddler, I realised this only solves the problem because of the version the IDE downloads.

因此,正确的解决方法是将较旧的非AMD jQuery版本添加为全局范围库,并将最新版本添加为项目范围库.

So, the correct workaround is to Add older, non-AMD jQuery versions as a Global scoped Library and add the latest one as a Project scope library.

最新的非AMD版本是:

The latest non-AMD versions are:

1.10.2 (对于1.x系列).并且, 2.0.0 用于2.x系列.

1.10.2 for 1.x series. And, 2.0.0 for 2.x series.

这篇关于phpstorm无法解析的函数或方法$()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 08:13