/    Sign up×
Community /Pin to ProfileBookmark

object.Prototype & internet explorer issue

Hi,

I have a page with a google map on it. Markers are placed on the map as GMarker objects. The problem I’m having is that I need to add a few properties to each marker which was done quite easily in firefox by adding:

GMarker.prototype.info = {};

then after each marker is created:

marker.info = { a:1, b:2, … };

Internet explorer 6 & 7 error with “Expected identifier, string or number” on the line that sets marker.info

If anyone has any suggestions that could help me overcome this issue without having to install VisualStudio to get a javascript debugger working in ie that would be great.

Thanks

{solved}

Apparently IE has an issue with trailing commas that ff does take issue with.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@mrhooJan 22.2008 — You'll find the same problem with defining a function with

function(a,b,). the mozilla browsers seem to ignore it in an object literal,

but the other browsers are with IE on this one.
×

Success!

Help @tfk11 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...