jQuery修复了“Uncaught TypeError:$ is not a function”错误 [英] jQuery fix for "Uncaught TypeError: $ is not a function" error

查看:7198
本文介绍了jQuery修复了“Uncaught TypeError:$ is not a function”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>      
<script src="http://someothersite.com/external.js"></script>

external.js:

external.js:

$("head").append(unescape(""));

不幸的是,当我包含我的外部脚本时,我收到以下错误:

Unfortunately I am getting the following error when I include my external script:


未捕获TypeError:$不是函数

Uncaught TypeError: $ is not a function

我如何修复这个?请记住,我不能编辑外部Javascript文件,因为它是第三方。

How do I fix this? Please bear in mind I can't edit the external Javascript file as it's third party.

推荐答案

它使用的是旧版本jQuery。

It was using an old version of jQuery.

我更新了版本,这解决了我的问题。

I updated the version and this resolved the issue for me.

Woop!

这篇关于jQuery修复了“Uncaught TypeError:$ is not a function”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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