var gmap = null; $(function(){ var myLatlng = new google.maps.LatLng(32.50089302,131.44387283); var mapOptions = { zoom: 17, center: myLatlng, disableDoubleClickZoom: true, scaleControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP } var gmap = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); var marker = new google.maps.Marker({ position: myLatlng, map: gmap, title: '美郷町立北郷歯科診療所' }); $( "#dialog-chk" ).dialog({ autoOpen: false, modal: true, width:600 }); /*--------------フリーワード act free---------------------*/ $("body").on("click", "#btn-free", function(){ var frmdata = $("#frmFindFree").serialize(); $.ajax({ url: "js/a-index.php", type: "POST", dataType: "json", async: true,/*非同期*/ data: frmdata, success: function(data){ if(data.length == 0){ var stitle =$("#dialog-chk").dialog("option","title"); $("#dialog-chk").dialog("option","title", "検 索 結 果"); $("#chkmsg").html("該当する医療機関データが見つかりません!条件を変更してください"); $("#dialog-chk").dialog( "option", "buttons", [{ text: "O K", click: function() {$( this ).dialog( "close" );$("#dialog-chk").dialog("option","title", stitle);$("input[name='word']").focus();} }]); $("#dialog-chk").dialog("open"); }else{ location.href="/search/?act=fin"; } }, error: function (XMLHttpRequest, txtStatus, errorThrown) { $("#dialog-chk").dialog("option","title", "エラー"); $("#dialog-chk").dialog("option","buttons",[{text:"OK",click:function(){$(this).dialog("close");}}]); $("#chkmsg").html('txtStatus:'+txtStatus+', errorThrown:'+errorThrown.message); $("#dialog-chk").dialog("open"); } }); }); });