//js 工具
//---------------请求
var url,parameters;
//请求数据
function requestData(url, parameters, successCallback, errorCallback){
	$.ajax({
	    type : "POST",
	    url : url,
	    data : JSON.stringify(parameters),
	    dataType : "json",
	    success : function(data) {
	    	successCallback(data); 
	    },
	    error : function(data) {
	    	errorCallback(data);
	    }
    }); 
}
//async:false,  
function asyncAjaxData(url, parameters, requestAsyncFail){
	var ajaxData;
	$.ajax({
	    type : "POST",
	    url : url,
	    async:false,
	    data : JSON.stringify(parameters),
	    dataType : "json",
	    success : function(data) {
	    	ajaxData=data;
	    },
	    error : function(data) {
	    	requestAsyncFail(data);
	    }
    }); 
	return ajaxData;
}
function requestAsyncFail(e){
	console.log(e);
}
function successCallback(e){
	console.log(e);
}

function errorCallback(e){
	console.log(e);
}

//---------------工具
function alertUtil(msg){
	var str = '<div class="earphone-layout"><div class="earphone-dialog">';
	str+= '<div class="earphone-content fc-white bg-dpur pad-tb-50">';
	str+= '<p class="fs-14"></p><p class="mar-t-25 fs-12">'+msg+'</p></div>';
	str+= '<div class="earphone-footer ub fs-14 bg-white">';
	str+= '<div class="ub-f1 pad-tb-30 fc-lgrey earphone-dialog-del">确定</div>';
	str+= '</div></div>';
$('body').append(str);
$('.earphone-dialog-del').one('click',function(){
	$('.earphone-layout').remove();
});
}
