Use $( window ).load to avoid potentially clobbering handlers

* Use location global

Change-Id: I526e3ff9e7dea89a6abf5c0b907b3949fe903591