方法表达式不是函数类型 [英] Method expression is not of Function type

查看:721
本文介绍了方法表达式不是函数类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下JavaScript文件:

I have the following JavaScript file:

/*global $ */

function foo() {
    'use strict';
    var $tr = $('table tr'),
        $td = $tr.children('td');

    $td.html('Hello World');
}

在PHPStorm中,children下划线带有弱警告.将鼠标悬停在上面可以显示以下消息:

In PHPStorm, children gets underlined with a weak warning. Mousing over it reveals this message:

方法表达式不是函数类型

Method expression is not of Function type

此文件与jquery.min.js位于同一目录(如果重要,请参见v.1.11.0).

This file is in the same directory as jquery.min.js (v. 1.11.0, if that matters).

我该如何解决?

请注意,上面的示例是一个极简示例,足以重现该问题;这不是我的实际代码,但是会产生相同的结果.

Note that the above example is a minimalist example sufficient to reproduce the problem; it's not my actual code, but it will product the same result.

推荐答案

感谢Arun P Johny的回答.我需要在项目中的某个地方安装jquery-1.11.1.js(未压缩的版本).我添加了它,PHPStorm立即解决了所有与jQuery相关的警告.

I have my answer thanks to Arun P Johny. I needed to have jquery-1.11.1.js (the uncompressed version) somewhere in my project. I added it, and PHPStorm immediately resolved all jQuery-related warnings.

这篇关于方法表达式不是函数类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆