2013-10-01 4 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 
}); 
관련 문제