[英]“Google is not defined” error on ruby on rails
我有一個html和js文件(maps_scripts.js),其中定義了與上述html頁面相關的所有google maps函數。 這兩個工作真的很好。
我被分配將這些文件包含到其他人開發的jruby on rails項目中。
到目前為止,這些是我采取的步驟。
添加
<%= javascript_include_tag 'https://maps.googleapis.com/maps/api/js?key=my_key&libraries=places' %> "
到我的html.erb頁面
包括
<%= javascript_include_tag 'map_scripts.js', 'data-turbolinks-track' => true %>
到我的html.erb頁面
題
我越來越
Uncaught ReferenceError: google is not defined at map_scripts.self-09044ded37604e5a1f367207911e2c79370a307b67a4be3178923d19f555011c.js:4
注意 :我有幾個
google.maps.*
在maps_scripts.js文件中調用。 對於一個實例
您缺少腳本或map_scripts.js中腳本的順序錯誤。 嘗試更改順序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.