It turned out to be a jQuery conflict.
TypeError: $ is not a function $("#location").prepend('<div id="map"></div>');
—
jQuery(document).ready(function($) {
$("#location").prepend('<div id="map"></div>');
});
Worked.
I'll make sure I use pastebin in the future. Thanks for your time.