json问题

路由:Route::post('classify/{id}/destroy/{data}', array('as' => 'admin.classify.destroy', 'uses' => 'ClassifyController@destroy'));

网页:
<form id="edit-profile" class="form-horizontal">
<fieldset>
<hr />
<div class="control-group">
<label class="control-label" for="username">用户名</label>
<label class="control-label" for="type">类型</label>
<label class="control-label" for="handle">操作</label>
</div>
<!-- /control-group -->
<hr />
<div class="control-group">
@if(count($classData) != 0)
<label class="control-label" for="username">{{ $username }}</label>
<label class="control-class" for="classify">
@foreach( $classData as $key => $value)
<input type="checkbox" name="classify" id="{{ $key }}" value="{{ $value }}" />&nbsp;&nbsp;{{ $value }}<br />
@endforeach
</label>
<label class="control-label" for="delete"><a href="javascript:;" id="delete">删除</a></label>
@endif
<script type="text/javascript">
var url = "{{ URL::route('admin.classify.destroy', $id) }}";

$(function(){
$("[name = classify]:checkbox").click(function(){
var data = {};
$("[name = classify]").each(function () {
if($(this).attr('checked') == 'checked'){
data[$(this).attr('id')] = $(this).val();
}
});
$('#delete').click(function(){
alert('1111111');
$.ajax({
type: "POST",
url: "url",
data: "data",
dataType: "json",
success: function(){
alert('数据传输成功!');
}
});
});
});
});
</script>
</div>
<hr />
</fieldset>
</form>
问题:
怎么ajax跳不过去?求大神帮帮忙,谢谢!
已邀请:

motecshine - 菜鸟

赞同来自:

你还需要有个error事件 然后F12看浏览器响应

要回复问题请先登录注册