URLからjsonを再実行するためにajaxリクエストを使用しています。
これは以下のようにローカルで機能しています:
$.ajax({
url: "http://localhost:8080/updates.json",
type: 'post',
dataType : "json",
success : function(jsonResponse) {
});
},
error: function (err) {
}
});
URLは、デプロイされているサーバーに関係なく機能するように更新する必要があります。
URLを次のようなものに置き換えることができます: "http://" + getThisHostName()+ ":8080 / updateds.json"?
現在のホスト名パスを返す安全な方法はありますか?