can someone please help me, I am having trouble implementing this, i just want the map to center when the window is resized. But it wont eve load the map

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

#map {

    position:absolute; top:0; left:0; width:100%; height:100%;
var myOptions = {
    center: new google.maps.LatLng(35.02, 111.02),
    zoom: 8,
    mapTypeId: google.maps.MapTypeId.ROADMAP

var map = new google.maps.Map(document.getElementById("map"), myOptions);

$(window).on('resize', function(){var currCenter = map.getCenter();google.maps.event.trigger(map, 'resize');map.setCenter(currCenter);


<div id="map"></div>