anchor.diff:  }
   
   
  -function update(){
  -	alert("업데이트 요청되었습니다.");
  -}
  +function getRefreshChapter(){
  +	$('#uidemo-modals-alerts-success').modal('show');	
  +}
  +
  +
  +
  +/* form data to json */
  +$.fn.serializeObject = function()
  +{
  +    var o = {};
  +    var a = this.serializeArray();
  +    $.each(a, function() {
  +        if (o[this.name] !== undefined) {
  +            if (!o[this.name].push) {
  +                o[this.name] = [o[this.name]];
  +            }
  +            o[this.name].push(this.value || '');
  +        } else {
  +            o[this.name] = this.value || '';
  +        }
  +    });
  +    return o;
  +};
  + 
   </script>
   
  
positive.code: 	});	
  
  }
  
  
  
  function getChapterList(index, code, name, description){
  	var innerDiv = '';
  
negative.code: 		},
  
  		error : function(data, status, err) {
  			//에러처리
  		}
  	});
  	
  }
  
  function registeChapter(){
  
  	var json_val = JSON.stringify($("#chapter-regist-form").serializeObject());
  
  	var urlValue = 'http://dev.api.coursevil.org/api/lecture/'+lectureCode+'/chapter';
  	
  	 $.ajax({
  		type : 'POST',
  		async : false,
  		url : urlValue,
  		cache : false,
  		contentType : "application/json; charset=UTF-8",
  		data : json_val,
  		success: function(data, textStatus, jqXHR)
  		{
  			$('#chapterModal').modal('hide');
  			getRefreshChapter();
  		},
  		error: function (jqXHR, textStatus, errorThrown)
  		{
  			// 에러처리
  		}
  	});
  	
  