ya********@yahoo.com wrote:
I use the following to translate button names in Google Maps:
G_NORMAL_MAP.getName = function(short) {
if(short) {return "Karta"}
return "Karta";
}
It works (tested) with Firefox 1.5 (Linux and Mac) and
Opera 9 (Mac). But Safari 1.3. says "Parse error".
What is wrong - code or Safari?
I don't have a copy of Safari to test with (and cannot be bothered to
load Knoppix to see if Konqueror has the same issue), but if automatic
semicolon insertion was not properly implemented in Safari then the
absence of a semicolon at the end of the first return statement may be
the problem. That can be tested by replacing:-
if(short) {return "Karta"}
- with:-
if(short) {return "Karta";}
- or:-
if(short) {
return "Karta"
}
The missing semicolon should be inserted as the 'offending token' is },
but maybe it hasn't been in Safari.
Richard.