フォーム付きの HTML ページを作成し、送信時にこのイベント ハンドラーを使用して JavaScript を呼び出します。
onClick = operation(this.form)
JavaScript は次のとおりです。
function operation(x) {
//url:"C:\Users\jhamb\Desktop\assignment_1_18_1_13\question_3\ques\form1.html",
url:"http://localhost:8080",
$.ajax({
data:{
comment:x.comment.value, // information from html page
email: x.email.value, // information from html page
url:x.url.value, // information from html page
name:x.name.value, // information from html page
}
}).done(function(serverResponse){
alert("response is ready"); //here you can handle server response
}).fail(function(err){
alert("ohhh!!! there is some error"); //here you can handle errors
});
//alert(obj.details[3].comment_value);
}
今私が欲しいのは、同じシステム上にあるサーバーとクライアントの間で通信することです。コードが機能しません。今、私は何ができますか、助けてください。