可在jsFiddle中使用,但不能在我的网站中使用 [英] Works in jsFiddle but not in my Site

查看:74
本文介绍了可在jsFiddle中使用,但不能在我的网站中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,我在网站上拥有的jQuery代码将在jsFiddle上运行,但不能在本地运行.代码是一样的.我刚刚复制并粘贴了它.谁能告诉我发生了什么事?

For some reason this jQuery code I have in my site will work on jsFiddle but not locally. The code is the same. I have just copied and pasted it. Can anyone explain to me what is going on?

  • jsFiddle
  • Local

推荐答案

使用Chrome的开发人员工具,在控制台中出现错误:Uncaught SyntaxError: Unexpected token ILLEGAL

Using Chrome's developer tools, you get an error in the console: Uncaught SyntaxError: Unexpected token ILLEGAL

看一下代码,您会看到:

Taking a look at the code, you see:

$(document).ready(function() {

    $('#workclick').click(function() {
    $("#header").height($("#headwrapper").height());

    });
    $('#workclick').click();

    $('#aboutclick, #contactclick, #introclick').click(function() {
    $("#header").height('0');
    });​ // here
});

某种编码错误...

这篇关于可在jsFiddle中使用,但不能在我的网站中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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