-2
$( "#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"
                 })
            },
    });
4

1 回答 1

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
});
于 2013-10-01T12:51:39.380 回答