473,320 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Safari and class method replacement

Hello!

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?

Thanks,
Dmitri

Jul 13 '06 #1
4 1473
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.
Jul 13 '06 #2

Richard Cornford писал(а):
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.
Thank you for advice, but apparently problem is not with semicolon
(i.e. I added it, it didn't help)

Safari insists that "Syntax Error - Parse Error" is on the following
line:

G_NORMAL_MAP.getName = function(short) {

Jul 14 '06 #3

ya********@yahoo.com wrote:

[snip]
Safari insists that "Syntax Error - Parse Error" is on the following
line:

G_NORMAL_MAP.getName = function(short) {
[/snip]

"short" may be a reserved keyword.

See: <URL:http://www.javascriptkit.com/jsref/reserved.shtml>

Try a different Identifier name for the function argument.

Regards

Julian Turner

Jul 14 '06 #4

Julian Turner писал(а):
Try a different Identifier name for the function argument.
Thanks! That was it.
You saved me from implementing custom map control :-)

Jul 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Duderonomoy | last post by:
Hello, I am querying the JavaScript community to learn if others are having problems with Safari and JavaScript arrays: myImages = ; then referenced like this:
1
by: gerry | last post by:
Hi, although this is not strictly asp.net related, I was hoping that someone could confirm or debunk what appears to be a major problem with safari POSTs. with the following html : <!DOCTYPE...
2
by: cbjewelz | last post by:
Hey all. So I'm having problems with cross browser alignments. I'm looking at Safari and Mozilla Firefox. I develop in Safari and so it looks perfect there however in Firefox my vertical...
1
by: gconrads | last post by:
Appreciate any advice: I'm working on a small script to swap out an image using javascript, this is my first attempt at using javascript. My method works fine in Firefox, but not in Safari....
21
by: Edward | last post by:
Hi All, I feel frustrated with one of my Customers who wants me to ensure that a dotnet web site I am building for them must be compatible to Apple's Safari browser! Safari is buggy and it...
2
by: Phrogz | last post by:
Years ago I wrote a library to turn normal <selectsinto text inputs that the user can type in, with various features. In those days, I was working for an IE-centric company, so I didn't spend the...
1
by: jholg | last post by:
Hi, regarding automatically adding functionality to a class (basically taken from the cookbook recipee) and Python's lexical nested scoping I have a question wrt this code: #-----------------...
7
by: David Stone | last post by:
Run into something recently that has left me a little puzzled. According to the examples in section 13.6.1 of html 4.01... <http://www.w3.org/TR/html401/struct/objects.html#h-13.6.1.1> I...
15
by: GinnTech | last post by:
I have a site that works perfectly in IE6 IE7 FF2 FF3 but not in the latest Safari. Here is the issue. I am attempting to call functions within a flash object. When trying to attempt to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.