2013-10-01 85 views
-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:"[email protected]" 
       }) 
      }, 
    }); 
+0

看起來你有失蹤')'在倒數第二行。然而,你的服務器返回415錯誤,'newteacher'發生了什麼? –

回答

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:"[email protected]" 
        })        //json end 
       }          //data end 
      });           //ajax end 
     }            //function end 
    }             //button end 
}); 
相關問題