我在轨道上,当我看到这个时,谷歌方向小部件会加载。
<div>
<script src="//www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/114281111391296844949/driving-directions.xml&up_fromLocation=&up_myLocations=<%= @meeting.location.address %>&up_defaultDirectionsType=&up_autoExpand=&synd=open&w=320&h=55&title=Directions+by+Google+Maps&lang=en&country=US&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>
</div>
但是,如果我的页面上有一个链接,比如称为“方向”,并且希望在有人单击方向时将上述内容加载到颜色框中,则该小部件不会加载。
$(".location-directions").click(function(){
$(this).colorbox({
open: true,
href: "/directions?mid=<%= @meeting.id %>",
width: "400px",
height: "300px",
overlayClose:true,
escKey:true,
returnFocus:true
});
return false;
})
打开的颜色框是空的。没有小部件。“/directions”路由再次打开一个具有相同谷歌脚本路径的视图:
<div>
<script src="//www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/114281111391296844949/driving-directions.xml&up_fromLocation=&up_myLocations=<%= @meeting.location.address %>&up_defaultDirectionsType=&up_autoExpand=&synd=open&w=320&h=55&title=Directions+by+Google+Maps&lang=en&country=US&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>
</div>
有什么线索吗?