ajax 拼url地址,真的是门学问......

前端之家收集整理的这篇文章主要介绍了ajax 拼url地址,真的是门学问......前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
	<script language="javascript" type="text/javascript" src="{{ URL::asset('/third-party/aui/js/aui-dialog.js') }}"></script>
	<script type="text/javascript">
  
		var dialog = new auiDialog();
		function openDialog(type,address_id){
			switch (type) {
				case "text":
					dialog.alert({
						title:"确认要删除此地址吗?",buttons:['取消','确定']
					},function(ret){
						if(ret.buttonIndex == 2 ){
						//删除地址
						var address = '/topm/delete_address/' + address_id;
						var url = "{{ url('') }}" + address;
						$.ajax({
							type:"GET",url: url,data: {
								address_id:address_id,_token:'{{ csrf_token() }}'
							},datatype:"JSON",async:true,success:function(data)
							{
								if(data == 0){
									console.log(data);
									location.reload();
								}
							}
						});
					}
					})
					break;
			    	default:
					break;
			}
		}
		</script>
原文链接:https://www.f2er.com/ajax/161111.html

猜你在找的Ajax相关文章