JS 动态传函数作为参数

JS 动态传函数作为参数_第1张图片

.Html({
			url : "t1.html",
			success:function(result){
				Popup(t,result);
			}
		});
		Html = function(cf){
	$.ajax({
		url:cf.url,
		type:"get",
		dataType: "html",
		async:false,
		success:function(result){
			cf.success.call(this,result);	
		},
		error:function(result){
			var text = result.status +" :  "+ result.statusText;
			console.log(text);
		}
	});

 

你可能感兴趣的:(JavaScript)