开发者

How to load a Rails View inside an infobox using gmaps4rails & JQuery Ajax?

I would like to 开发者_Go百科know how can I load a Rails View inside a Infobox opened by Gmaps4Rails.infobox.


I did this way and work fine. O secret is put serviceObject, in some example show google_object.

<% content_for :scripts do %>
    <script>
        Gmaps4Rails.callback = function() {
            for (var i = 0; i <  this.markers.length; ++i) {
                google.maps.event.addListener(Gmaps4Rails.markers[i].serviceObject, 'click', function(){
                    $('#info').load('/messages');
                    $('#info').dialog("open");
                });

            }
        };
    </script>
<% end %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜