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 <script>...</script> in the content string which calls a function that generates and then document.writes the 'mailto:' to the InfoWindow, but this seemed to be ignored.
I've also tried defining <span id="emailaddr">...</span> in the content, then executing document.getElementById('emailaddr').innerHTML=emailAddress(); as the last statement in the Listener function defined on the Marker (i.e. after the InfoWindow has been displayed). The function emailAddress() constructs and returns the 'mailto: link and returns it. This also did nothing.
Is it possible to embed JavaScript in the content of an InfoWindow, and have it execute when the InfoWindow is displayed, in this way? If not, is there another technique that will achieve what I want, or am I left hard coding the email address in the content string?
Any constructive help/advice gratefully received. I'm developing/testing in Chrome 10.0.648.133, but any solution needs to be cross-browser.
Thanks,
John