415不支持的媒体类型是什么意思

时间:2013-10-01 09:58:32

标签: jquery

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

1 个答案:

答案 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
});