简体   繁体   English

Chardin Js,混合Cordova移动应用程序-“未定义”不是一个功能

[英]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.

相关问题 混合移动应用程序在添加cordova.js时崩溃 - Hybrid mobile application crash while adding cordova.js 如何使用Cordova处理混合移动应用程序的后退按钮功能 - How to handle the back button functionality for Hybrid mobile application using cordova 混合密码学在混合移动应用中的应用 - Hybrid Cryptography in hybrid mobile application Apache Cordova - 混合移动应用程序页面像 Chrome 浏览器一样打开,而不像cordova 应用程序 - Apache Cordova - Hybrid Mobile Application page opening like a chrome browser not like cordova application 与Crosswalk + Cordova + Eclipse的混合应用程序 - Hybrid Application with Crosswalk + Cordova + Eclipse 在混合移动应用程序中启用了拼写检查 - Spellcheck enabled in Hybrid Mobile application 如何创建Cordova Blackberry(Hybrid)应用程序 - How to create Cordova Blackberry (Hybrid) application 如何在Cordova混合移动应用程序中集成NetScalar登录? - How to integrate NetScalar login in cordova hybrid mobile app? 混合移动应用程序中的XMLHttpRequest异常101 - XMLHttpRequest Exception 101 in hybrid mobile application Google Maps在混合移动应用程序中缓存切片 - Google Maps caching tiles in hybrid mobile application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM