jsFiddle can't use externall resource like Google Place API?

旧时模样 提交于 2020-01-05 10:06:09

问题


I prepare some small code http://jsfiddle.net/VW9uR/ with External Resource to Google Place API, but the resource doesn't work.
The source is: http://maps.google.com/maps/api/js?sensor=false&libraries=places
How to add correct resource?


回答1:


jsfiddle needs a file-extension to determine which type of file should be loaded. Where no file-extension is available add the extension to the QUERY_STRING, e.g.:

 http://maps.google.com/maps/api/js?sensor=false&libraries=places&.js

Demo: http://jsfiddle.net/doktormolle/y939C/

Documentation: http://doc.jsfiddle.net/basic/introduction.html#external-resources




回答2:


you can add script tag in the html and make it on domready

<script src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>

find it working here



来源:https://stackoverflow.com/questions/17564221/jsfiddle-cant-use-externall-resource-like-google-place-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!