Thanks Rossko, i'm doing the developing in local that i don't have a
link yet.
Anyway i'm aware of the timing issue: the element id doesn't exist in
DOM till a short time, less than half sec.
I should show you more details as below
1. This is how i get the content loaded.
map.addOverlay(marker);
marker.openInfoWindowHtml('<div id="info_bubble"><img src="/mysite/img/
loading.gif"></div>');
setTimeout(function(){
$("#info_bubble").load("/mysite/markers/add");
}, 1000);
2. And here comes the snippet (in html source) of my content page
<form onsumbit="event.returnValue = false; return false;"
id="MarkerAddForm" method="post" action="/mysite/markers/add">
<fieldset style="display:none;"><input type="hidden" name="_method"
value="POST" /></fieldset>
<script>
//<![CDATA[
Event.observe('MarkerAddForm', 'submit', function(event) { new
Ajax.Updater('myicons','/mysite/markers/add', {asynchronous:true,
evalScripts:true, parameters:Form.serialize('MarkerAddForm'),
requestHeaders:['X-Update', 'myicons']}) }, false);
//]]>
</script>
......
<input type="submit" id="save" value="Save"/>
</form>
On 1月24日, 下午7时04分, Rossko <[email protected]> wrote:
> > .... is there anything special in this little
> > magic area?
>
> Yes. For example, <div id="info_bubble"> doesn't exist in the DOM
> until a short time after the openinfowidow, so the timing of when $
> ("#info_bubble").load(...); is executed becomes crucial. You
> snippet doesn't tell us about that. Show us -
> http://groups.google.com/group/Google-Maps-API/web/why-including-a-li...
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.