# Google Maps: How to display infoWindow with Ajax?

**URL:** <https://www.ruby-forum.com/t/google-maps-how-to-display-infowindow-with-ajax/152898>\
**Category:** Rails\
**Created:** [November 9, 2008, 9:07am UTC](https://www.ruby-forum.com/t/google-maps-how-to-display-infowindow-with-ajax/152898 "2008-11-09T09:07:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [November 9, 2008, 9:07am UTC](https://www.ruby-forum.com/t/google-maps-how-to-display-infowindow-with-ajax/152898/1 "2008-11-09T09:07:47Z")

</div>

I have different restaurant makers on maps.  
When I click one marker, it is supposed to show restaurant name and  
address after fetching from server at run time.

Currently I am doing this…  
restaurant#{restaurant.id}marker.openInfoWindowHtml("#{restaurant.name}");

It is a problem when there are so many restaurants in map.

How can I fetch at runtime?

Thanks.
