// 获取路径上下文
getContextPath : function() {
var url = top.location.href;
return url.substring(0, url.lastIndexOf("/"));
},
// 获取随机数
getIndexTime : function() {
return new Date().getTime();
},
// 设置form版本号
setSubmitVersion : function(from, version) {
$.get('utils/submit_seq.json?id=' + new Date().getTime(), function(data) {
$(from).find(version).val(data);
},'text');
},
// 设置工作流版本号
setWorkVersion : function(from, version,flowId) {
$.get('common/getWorkVersion.json?flowId='+flowId+'&id=' + new Date().getTime(), function(data) {
$(from).find(version).val(data.version);
});
},
getContextPath : function() {
var url = top.location.href;
return url.substring(0, url.lastIndexOf("/"));
},
// 获取随机数
getIndexTime : function() {
return new Date().getTime();
},
// 设置form版本号
setSubmitVersion : function(from, version) {
$.get('utils/submit_seq.json?id=' + new Date().getTime(), function(data) {
$(from).find(version).val(data);
},'text');
},
// 设置工作流版本号
setWorkVersion : function(from, version,flowId) {
$.get('common/getWorkVersion.json?flowId='+flowId+'&id=' + new Date().getTime(), function(data) {
$(from).find(version).val(data.version);
});
},
本文介绍了一组用于前端开发的实用工具方法,包括获取路径上下文、生成随机数、设置表单及工作流版本号等功能。这些方法可以帮助开发者提高工作效率,简化常见的开发任务。
3万+

被折叠的 条评论
为什么被折叠?



