[英]Chardin Js , Hybrid Cordova mobile application - “undefined” is not a function
I am trying to create "coach marks"/ instruction overlays in my hybrid mobile app using Jquery and the Chardin.js library : https://github.com/heelhook/chardin.js 我正在尝试使用Jquery和Chardin.js库在混合移动应用程序中创建“教练标记” /指令叠加层: https : //github.com/heelhook/chardin.js
But unfortunately I keep getting this error : 但不幸的是,我一直收到此错误:
[FATAL] [NONE] Uncaught Exception: TypeError: 'undefined' is not a function (evaluating '$('body').chardinJs('start')') at (compiled_code):5 [FATAL] [NONE]未捕获的异常:TypeError:'undefined'不是函数(在(compiled_code):5处评估'$('body')。chardinJs('start')')
this is how my JS file looks like : 这是我的JS文件的样子:
$(document).ready(function() {
console.log("IN CHARDIN INIT");
$('.container').chardinJs('start');
});
And I load all the files in the HTML file like this (this code is not showing all the div elements for simplicity): 我将所有文件加载到HTML文件中,如下所示(为简单起见,此代码未显示所有div元素):
<head>
<link rel="stylesheet"
href="../../css/jquery/mobile/1.3.2/jquery.mobile.structure-1.3.2.min.css" />
<script src="../../js/jquery/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<!-- Chardin/ Coach marks stuff -->
<script src="../../js/chardin/chardinjs.min.js"></script>
<link href="../../js/chardin/chardinjs.css" rel="stylesheet" />
</head>
<body>
<!-- Coach marks stuff -->
<script type="text/javascript" src="../../js/chardin/chardinInit.js"></script>
</body>
Am I doing something wrong here ?? 我在这里做错什么了吗?
After days of debugging I found out that the ChardinJs lib was not loading and I had to add it to the body of HTML to load. 经过数天的调试,我发现ChardinJs库没有加载,因此我不得不将其添加到HTML主体中以进行加载。
The other thing was that Chardin JS has a dependancy that is not mentioned on their website. 另一件事是,Chardin JS的依赖性在其网站上未提及。 It needs the bootstrap plugin that I was missing.
它需要我所缺少的bootstrap插件。 As soon as I added this dependancy, It started working.
一旦添加这种依赖性,它就开始起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.