我在轨道上,当我的视图中有这个时,谷歌方向小部件就会加载。
<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;
})
打开的颜色框为空。没有小部件。"/方向"路线打开一个视图,该视图再次具有相同的谷歌脚本路径:
<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>
有线索吗?
我遇到了同样的问题,在我花了5个小时尝试不同的东西后,我终于发现我应该把"http:"放在//www="。。。所以应该是"http://www.gmodules.com...etc"希望这有点帮助,去睡觉吧。