Warning: mysql_connect() [function.mysql-connect.php]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/waterwav/public_html/weblog/includes/weblog.php on line 44

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/waterwav/public_html/weblog/includes/weblog.php on line 337

Warning: Invalid argument supplied for foreach() in /home/waterwav/public_html/weblog/includes/functions.php on line 66

Warning: in_array() [function.in-array.php]: Wrong datatype for second argument in /home/waterwav/public_html/weblog/includes/functions.php on line 87

Warning: Invalid argument supplied for foreach() in /home/waterwav/public_html/weblog/includes/functions.php on line 92

Warning: reset() [function.reset.php]: Passed variable is not an array or object in /home/waterwav/public_html/weblog/includes/functions.php on line 101

Warning: Variable passed to each() is not an array or object in /home/waterwav/public_html/weblog/includes/functions.php on line 111
x-log: Opera 9.25 vs Safari JavaScript syntax error forgiveness

Thèmes

Liens

License

Creative Commons License

Unless otherwise expressly stated, all original material of whatever nature created by Andreas Jaggi and included in this weblog is licensed under a Creative Commons License.

Opera 9.25 vs Safari JavaScript syntax error forgiveness, 9.08.2008 01:15

The following definition of an Array works without problems in Safari (and probably Firefox too), but triggers an (legitimate) error in Opera 9.25:

var myArray = [
 1.2,
 2.3,
 3.4,
];

The error is triggered by the superfluous comma after the last element of the Array. It may be argued for both behaviors, but I would prefer all Browsers accepting such an Array definition also since in other languages (C, Python, PHP) such a redundant comma does not cause any trouble.