未捕获的语法错误:意外的令牌ILLEGAL [英] Uncaught SyntaxError: Unexpected token ILLEGAL

查看:207
本文介绍了未捕获的语法错误:意外的令牌ILLEGAL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

非预期的令牌ILLEGAL在webkit

我写了一个简单的脚本对于此网站的 http://jsfiddle.net/paDmg/368/ 此悬停效果< a href =http://avuedesigns.com/new/ =nofollow> http://avuedesigns.com/new/ - 它适用于jsfiddle,但我得到未捕获的语法错误:意外令牌ILLEGAL在我的javascript,当我把它。它在线29上告诉我哪个是结束标记});

I wrote a simple script for a hover over effect here http://jsfiddle.net/paDmg/368/ for this site http://avuedesigns.com/new/ - It works on jsfiddle, but I am getting "Uncaught SyntaxError: Unexpected token ILLEGAL" in my javascript when I put it live. Its on line 29 it is telling me which is the closing marks });​

$('#hover-grid .indiv-cell').hover(function() {

//set variables to current cell attributes
var cellHeader = $(this).attr('data-hoverheader');
var cellText = $(this).attr('data-hovertext');
var replacementImg = $(this).find('a img').attr('data-replacementimg');
var oringinalImg = $(this).find('a img').attr('src');

//save original image to data variable
$(this).data('origImg', oringinalImg);



//add remove classes
$('#hover-grid .indiv-cell').removeClass('newClass');
$(this).addClass('newClass', 1000);
$(this).find('a img').hide().attr('src', replacementImg).fadeIn(300);
$('.master-cell h1').hide().text(cellHeader).fadeIn(300);
$('.master-cell p').hide().text(cellText).fadeIn(300);


//return false;
}, function() {
$(this).find('a img').hide().attr('src', $(this).data('origImg')).fadeIn(10);
});​


推荐答案

嵌入非法字符。使用十六进制编辑器查找JS,并查找任何不可见的ASCII字符的字符。他们可能被JSfiddle剥夺了

You probably have embedded illegal characters. Look in your JS with a hex editor and look for any characters that aren't visible ASCII characters. They may be getting stripped off by JSfiddle

请参阅 Chrome未捕获语法错误:意外令牌ILLEGAL

这篇关于未捕获的语法错误:意外的令牌ILLEGAL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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