0

私はレールに乗っており、これを表示すると、Googleのルート案内ウィジェットが読み込まれます。

<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」ルートは、同じgoogleスクリプトパスを持つビューを再び開きます。

<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>

手がかりはありますか?

4

1 に答える 1

0

I had the same problem and after i've spent the last 5 hours trying different things i finally figured out that i should put "http:" in front of the //www="... So it should be like "http://www.gmodules.com...etc" Hope this helps a bit,off to sleep.

于 2012-07-18T02:46:22.497 に答える