多くの投稿で頻繁に返される質問であることは知っていますが、何十もの回答を読んだ後でも、コードの何が問題なのかわかりません。
ポイントは、デフォルトの送信を防止し、応答 div で応答データを取得することです。コードが実際に行うことは、geocoder.php ページに直接送信することです。
どうもありがとう、
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
/* attach a submit handler to the form */
$("geostring").submit(function(event) {
/* stop form from submitting normally */
event.preventDefault();
/* get some values from elements on the page: */
var $form = $( this ),
term = $form.find( 'input[name="geo"]' ).val(),
url = $form.attr( 'action' );
/* Send the data using post */
var posting = $.post( url, { s: term } );
/* Put the results in a div */
posting.done(function( data ) {
var content = $( data ).find( '#content' );
$( "#answer" ).empty().append( content );
});
});
</script>
<form action="http://winefy.alwaysdata.net/geocoder.php" method="POST" id="geostring">
<input type=text name="geo" placeholder="Address..." />
<input type="submit" value="Geocode" />
<div id="answer"></div>
</form>