【发布时间】:2019-03-31 03:41:13
【问题描述】:
在 TypeScript 中使用 $(document) 会出现错误 Supplied parameters do not match any signature of call target.
我正在使用 TypeScript 3.1、jQuery 3.3.1 和 @types/jQuery 3.3.29。
$(document) 是否已弃用,我应该使用其他东西还是类型定义文件中的错误?
编辑: 这个 TypeScript 文件的整个正文基本上是“Hello World!”。
$(document).ready(() => {
console.log("Hello World!");
});
【问题讨论】:
-
你调用任何带参数的函数吗?
-
试试:
jQuery(document).ready(() -
jQuery(document)给出了同样的错误。
标签: jquery typescript