jQuery插件在JSfiidle中工作,不在我的页面中 [英] Jquery plugin working in JSfiidle and not in my page

查看:123
本文介绍了jQuery插件在JSfiidle中工作,不在我的页面中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此jQuery插件上缺少我可以在jsfiddle中而不是在我的页面中使用的东西.

There is something i am missing on this jquery plugin which works in jsfiddle and not in my page.

这是一个用于收银机效果的Jquery插件.在此处中查找,您可以在VALOR LIQUIDATIVO下面的数字上看到这种效果.

This is a Jquery plugin for cash Register effect. Look here and you can see this effect on the number below VALOR LIQUIDATIVO.

我在页面中粘贴了相同的代码,但是该插件无法正常工作.正如我在此

I have pasted the same code in my page, but the plugin is not working. There is probably an issue about the option to run the script code "onload" as i have seen in this thread but i am not figuring out the problem. How i have to modify the file for my browser?

推荐答案

您的问题似乎是语法错误.通常,如果发现语法错误,javascript就会中断,尽管我真的没有任何方法可以测试这种情况,但我相信这是您的问题.

Your problem appears to be a syntax error. Usually javascript will break if a syntax error is found, and although I don't really have any way to test if this is the case, I believe this to be your problem.

正如我在评论中说的,由于jsfiddle格式化文本的方式,当将数据从jsfiddle复制到实际脚本时,它倾向于复制不可见的字符,这些字符可能会破坏内容.

As I said in the comments, when copying data from jsfiddle to an actual script, it tends to copy in invisible characters that can break things, due to the way jsfiddle formats text.

当我从网页中将代码复制到Notepad ++(代码编辑器)中时,在函数调用后的第347行上我立即发现了一个隐藏字符.当然,这会显示为问号,如下所示:

When I copied your code, from your webpage, into Notepad++(a code editor), I found a hidden character directly after your function call, on line 347. This of course showed up as a question mark, like so:

$(document).ready(function() {

    $('#valorliquidativo').cashRegister();

});​
  ^ hidden character directly after this semi-colon

Chrome的javascript控制台说上面的字符是非法字符,因此请删除该行,手动将其键入,然后重试.看看是否有效.

Chrome's javascript console says the above is an illegal character, so delete that line, type it out manually, and try again. See if it works.

这篇关于jQuery插件在JSfiidle中工作,不在我的页面中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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