Skip to content

Instantly share code, notes, and snippets.

@1dolinski
Created April 23, 2014 01:56
Show Gist options
  • Save 1dolinski/11200431 to your computer and use it in GitHub Desktop.
Save 1dolinski/11200431 to your computer and use it in GitHub Desktop.
// Scenario 1
// run these sequentially, the google map closes
google.maps.event.addDomListener(window, 'load', initialize);
google.maps.event.clearInstanceListeners(window, 'load');
// Scenario 2
function run() {
google.maps.event.clearInstanceListeners(window, 'load');
}
google.maps.event.addDomListener(window, 'load', initialize);
// open the window and then in the console run:
run();
#=> undefined
// but in this case the map doesn't disapear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment