Re: [Google Maps API v3] Embed javascript in V3 InfoWindow

2011-03-17 Thread Chris Broadfoot
It doesn't look like you're missing anything. I had a look at the code and the approach you've taken is how I'd do it. Create a string with appropriate HTML, and then use it as the parameter to setContent. I can't comment on whether this is effective against spam bots, but the two techniques are

Re: [Google Maps API v3] Embed javascript in V3 InfoWindow

2011-03-17 Thread John James
Chris, thanks for your reply but, unless I'm missing something, that doesn't solve the issue I'm addressing as the email address is then hard-coded in the HTML sent to the browser and is therefore available to harvesters. Whereas if the JavaScript sent to the browser dynamically writes the HTML fo

Re: [Google Maps API v3] Embed javascript in V3 InfoWindow

2011-03-17 Thread Chris Broadfoot
I'd take a different approach. Generate the HTML *before* you call setContent on the InfoWindow. Example (not real code, just a demonstration on what I'd do: var infowindow = new google.maps.InfoWindow(); function onClick(marker) { infowindow.setContent('Email!'); infowindow.open(marker, map

[Google Maps API v3] Embed javascript in V3 InfoWindow

2011-03-16 Thread John James
I've been digging for a while and cannot figure this, so... I want/need to embed a snippet of JavaScript in an InfoWindow, to dynamically create a mailto: link (as a simple means of protection against email address harvesters). I've tried embedding a ... in the content string which calls a f