locked
Google Places Javascript API v.3 RRS feed

  • Question

  • As per Places API, I inserted the script tag

    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=MY_SECRET_KEY&libraries=places&sensor=true"></script>

    but the script fails to load. It silently fails (I assume) due to a script injection attempt. I have also tried loading the script form code and had the same result.

    Has anyone been using the new Google Javascipt (not JSON) API in a Metro-style Windows 8 app (not a web page)?

    Saturday, June 16, 2012 3:33 AM

Answers

  • You will have to use an iframe element that runs in the web context. The source of the iframe would be another html file that would reference the remote script.  Simple javascript functions are used to pass messages between the main body of your app and the iframe element.

    I wrote a blog post on this technique using the Customer Preview.

    ***Note, to update this for the Release Preview, take care to replace

    ms-wwa --> ms-appx

    and

    ms-wwa-web --> ms-appx-web

    in multiple places and multiple files. (In addition to other template changes.)

    • Proposed as answer by Dino He Monday, June 18, 2012 6:44 AM
    • Marked as answer by Ydnorok Monday, June 18, 2012 7:12 AM
    Sunday, June 17, 2012 2:35 PM