$( "#teacher-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Create an account":function(){
$.ajax({
url: 'newteacher',
type: 'POST',
contentType: 'application/json',
data: { json: JSON.stringify({
name:"Bob",
email:"xyz@xyz.com"
})
},
});
答案 0 :(得分:0)
你已经忘记了一些结束语。
试试这个
$( "#teacher-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: { //button start
"Create an account":function(){ //function start
$.ajax({ //ajax start
url: 'newteacher',
type: 'POST',
contentType: 'application/json',
data: { //data start
json: JSON.stringify({ //json start
name:"Bob",
email:"xyz@xyz.com"
}) //json end
} //data end
}); //ajax end
} //function end
} //button end
});