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
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
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
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