jquery line causing error

I have this line of jQuery and it causes an error on my page. The error message just says "An Error Was Encountered. Compilation error at line 81 in "string" : Parse error in "left: '+=50'}); }); });" Why would this line cause an error?

$(this).animate({left: '+=50'});

Comments

  • edited October 2011
    It's a Dwoo error. It sees the "{" and "}" and interprets it as template code. A couple ways to get around that:

    1. You can put the js in a file and include the file
    2. You can break the "}" to the next line.
  • edited 5:11AM
    Ok thanks. Breaking the "}" to a new line worked fine for me.
Sign In or Register to comment.