Response title
This is preview!
Good luck!Also try to make it fail without jQuery Mobile or jQuery.
If you use scripts that depend on Google Maps being loaded first, you have to load those scripts AFTER Google Maps code is fully loaded. "code that depends on Google Maps being loaded" means your scripts (that use Maps) and any libraries e.g. I use jquery.ui-map and friends.// This has to be a global function in order for the Maps API to make the callbackfunction riverTrailsMapApiLoadedCallback() {//"use strict";console.log("Google maps is fully loaded");// By triggering an event on the current page, we can catch this event and navigate to the// map if we are still on the same page as when the user hit some map button.// But if the user has navigated away from that page, we can just silently ignore// this, but now the map API is available for the next time the user hits a map button.$.mobile.activePage.trigger("mapapiloaded.rivertrails");}
- <!DOCTYPE html>
- <html>
- <head>
- <title>Page Title</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="http://code.jquery.com/mobile/[version]/jquery.mobile-[version].min.css" />
- <script src="http://code.jquery.com/jquery-[version].min.js"></script>
- <script src="http://code.jquery.com/mobile/[version]/jquery.mobile-[version].min.js"></script>
- </head>
- <body>
- ...content goes here...
- </body>
- </html>
That was the "latest approach" about ten years ago! This practice become popular for a while around 2008. Yahoo (remember Yahoo?) spearheaded this.I thought the latest approach was to put all the scripts at the bottom after the page content?
var window_home_history_state;var window_plans_history_state;
if (window_plans_history_state == null) {window_plans_history_state = window.history.state;}
This is called after I create the map. I need the map to complete before I hack the state because this is when Google trashes it.function setPlansState() { // hack for safari and google maps issueif (idevice) {if (window.history.state == null) {$.mobile.back();}history.replaceState(window_plans_history_state,"",window.location.href);}}
© 2013 jQuery Foundation
Sponsored by and others.