Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【kit.ajaxConstant】代替zepto中的ajax步骤 #9

Open
Kelichao opened this issue Feb 20, 2017 · 0 comments
Open

【kit.ajaxConstant】代替zepto中的ajax步骤 #9

Kelichao opened this issue Feb 20, 2017 · 0 comments

Comments

@Kelichao
Copy link
Owner

Kelichao commented Feb 20, 2017

kit.ajaxConstant AJAX步骤

  • 如果不需要传入常量步骤,直接执行该方法即可
// 如果这样执行,只有默认的["dataType", "error", "type"]
kit.ajaxConstant();
  • 如果传入发送前与完成时的方法
val = {beforeSend:fn1, complete:fn2};
kit.ajaxConstant(val);

一般用法流程(完整版)

// temp 中这两个方法通用
// 静态方法
var temp = kit.ajaxConstant({
	beforeSend: function() {
		// somecode
	},
	complete: function() {
		// somecode
	}
});

// 需要url,data,success
temp({
	url: kModel.get("tableUrl"),
	data: kModel.get("tableParam"),
	success: function(resp) {
		console.log(resp)
	}
});
@Kelichao Kelichao changed the title 【kit.ajaxConstant】zepto中的ajax步骤 【kit.ajaxConstant】代替zepto中的ajax步骤 Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant