当前位置:编程学习 > JS >>

解决难题JavaScript的!以下是代码?==帮我说说这端code的作用!

//Initialization TSN_WORKREQUIREMENT

sender = WF_PROCESSINSTANCEEXECUTOR;

var org = new Packages.com.aboveE.powerProcess.organization.OrganizationServer();
var user = org.getUser(sender);
if (user != null){
senderName = "發件人" + user.getName();
}

var unitId = null;
if(applicant=="null" || applicant==null || applicant=="")
unitId = applicantUnit;
else
unitId = org.getUnitFromUser(applicant);

if(unitId==null || unitId=="") error="unitId is invalid.";

var i=0;
if(compId==null){
do{
unitId = org.getParentUnit(unitId);
if(unitId==null || unitId=="") error="unitId is invalid.";
unit = org.getUnit(unitId);
if(unit==null) error="unit is null.";
i++;
if(i>50){
error="unit level is invalid.";break;
}
}while(unit.getLevel()>1)
var compId = unit.getID();
}

mngExecuter=compId+"_MNG_TSNWR";
checkUser=compId+"_AUD_TSNWR";
mngManager=compId+"_MNGManager_TSNWR";
if(httpServer==null || httpServer=="")
httpServer ="http://10.5.1.2:6060";

flowDesc="工作需求申請單"+tsnwrNo+"; "+senderName;
答案:
----Javascript刚出来的时候,许多人都以为Javascript和Java差不多,而事实上两者毫无二致.但这并不是说两者就毫无联系了.在Netscape Navigator 3.0以上的版本和IE4.0中,Javascript却可以和JavaApplet实现交互,也就是前台html与后台java声明的class的交互.
----在Javascript中有一个对象叫做packages,通过它可以调用Java API中的方法.比如
---- packages.java.lang.System.out.println("Hello,World!")

所以这段程序的意思就很好理解了:
javascript调用了java API的一个类Packages.com.aboveE.powerProcess.organization.OrganizationServer
获取了两个java API的对象user(用户)和applicantUnit(用户所在单位),经过一些处理后,拼接出一些描述性的字符串,和变量,供后续程序使用

上一个:谁帮我解释一下 Substring 变量在 C# 和 JavaScript 中的应用及不同之处。
下一个:谁能告诉我这段javascript脚本是怎么实现跑马灯效果的?

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,