2012-07-16 52 views
0

我在軌道上,當我在我的視圖中有這個,谷歌方向部件加載。加載谷歌方向小部件使用ajax + colorbox不工作

<div> 
    <script src="//www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/114281111391296844949/driving-directions.xml&amp;up_fromLocation=&amp;up_myLocations=<%= @meeting.location.address %>&amp;up_defaultDirectionsType=&amp;up_autoExpand=&amp;synd=open&amp;w=320&amp;h=55&amp;title=Directions+by+Google+Maps&amp;lang=en&amp;country=US&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;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&amp;up_fromLocation=&amp;up_myLocations=<%= @meeting.location.address %>&amp;up_defaultDirectionsType=&amp;up_autoExpand=&amp;synd=open&amp;w=320&amp;h=55&amp;title=Directions+by+Google+Maps&amp;lang=en&amp;country=US&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script> 
</div> 

任何線索?

回答

0

我有同樣的問題,並在我花了最後5個小時嘗試不同的事情後,我終於明白,我應該把「http:」放在// www =「... 所以它應該如「http://www.gmodules.com...etc」 希望這有助於一點點,睡覺。

+0

嗨blast250,感謝您的幫助。我其實已經嘗試添加http,但仍然沒有好運,我現在正在做其他事情,但稍後需要重新討論。 – absolutskyy 2012-07-24 20:50:20