简体   繁体   English

未捕获的TypeError:$(…).mywidget不是函数(…)

[英]Uncaught TypeError: $(…).mywidget is not a function(…)

I'm loading an external script in shopify. 我正在shopify中加载外部脚本。

<script type=text/javascript src=https://www.domain.com/static/../survey.min.js></script>

and I have a jquery in the body as 我体内有一个jQuery

<script type=text/javascript>$(document).ready(function () {
    $('#someID').mywidget({val: data});
});

but I'm getting 但我越来越

Uncaught TypeError: $(...).mywidget is not a function(…) 未被捕获的TypeError:$(...)。mywidget不是函数(...)

mywidget is a function in the external js file. mywidget是外部js文件中的函数。 It works fine in a normal html file. 它在正常的html文件中工作正常。 Any suggestions? 有什么建议么?

I'm not sure that you've defined jQuery in either of your scripts correctly... I don't see the correct SRC. 我不确定您是否已在两个脚本中正确定义了jQuery ...我看不到正确的SRC。 Try finding the latest version of jQuery and using its URL as the <script> 's SRC. 尝试查找最新版本的jQuery,并将其URL用作<script>的SRC。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM