This project is archived and is in readonly mode.

#1160 ✓invalid
Xunnamius

MooTools 1.3 "Syntax Error" in Safari

Reported by Xunnamius | January 30th, 2011 @ 09:01 PM

Example: http://dignityice.com/dg/prototype/swank/safari/swank (don't worry about submitting email addresses/pressing submit for testing purposes, the database is not "hooked up")

The code in the URL above is available for viewing and works in all browsers (even IE9!) except vanilla Safari 5.0.3 (7533.19.4) on Windows 7 x64 and possibly Opera (due to #1159).

Safari reports this in its error console: SyntaxError: Parse error on main.js:71

that line is $$('body')[0].grab(new Element('p', { id: 'pop', class: 'success', html: 'Email was submitted successfully (AJAX)!' }));

However, when I change the object's keys to literal strings (below), the "parse error" disappears!

$$('body')[0].grab(new Element('p', { 'id': 'pop', 'class': 'success', 'html': 'Email was submitted successfully (AJAX)!' }));

I believe it to be the class key that is angering Safari, but I have not done extensive testing on which literal keys safari likes and dislikes.

This "error" does not seem to pop up in any other browsers (possibly Opera, due to #1159).

Comments and changes to this ticket

  • Arian

    Arian January 31st, 2011 @ 07:32 PM

    • State changed from “new” to “invalid”

    class is a reserved word in js, you should use 'class' (with quotes). This is not a MooTools bug, it's a JavaScript thing.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages