2

Possible Duplicate:
Unexpected token ILLEGAL in webkit

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. It's 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);
});​
Community
  • 1
  • 1
Nadim Dayoub
  • 121
  • 1
  • 2
  • 10

1 Answers1

6

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

See Chrome Uncaught Syntax Error: Unexpected Token ILLEGAL

Community
  • 1
  • 1
Ruan Mendes
  • 90,375
  • 31
  • 153
  • 217
  • Thanks, removed the last line and retyped it and no more error. Now I got to figure out why it is not working now... – Nadim Dayoub Oct 01 '12 at 20:14