domino 常用JScode
domino域栏位添加HTMl 属性--@If(wfclzt!="仓管员办理";"style=\"border:0\" disabled";"")
视图列数值--转自动打开某文件。
res:=TxWPName;
"[<a href=javascript:OpenDoc('"+@Text(@DocumentUniqueID)+"');>"+res+"</a>]"
//制造模式子窗口
if (childwindow && !childwindow.closed)
{
childwindow.focus();
}
Print |<Script>
function OpenDoc(DocId){
var pathname = (window.location.pathname);
var pathname1=pathname.substring(0,(pathname.lastIndexOf('.nsf')+5));
var pathname2=pathname1+'0/'+DocId+"?opendocument";
window.open(pathname2,'_blank', 'toolbar=yes, menubar=yes, scrollbars=yes,resizable=yes,location=yes, status=yes,directories=yes')
} </Script>|
添加随机数缓存问题
$.getJSON(yes.comm.webfoldercount+"?"+new Date().getTime(),function(v){
+"?"+new Date().getTime(),function(v)
+"&time="+new Date().getTime(),function(v)
function OpenView(viewname)
{
var viewUrl = viewname + "?openview";
window.open(viewUrl,"view");
}
function OpenDoc(DocId)
{
var pathname = (window.location.pathname);
thisform = document.forms[0];
var pathname1=pathname.substring(0,(pathname.lastIndexOf('.nsf')+5));
var pathname2=pathname1+'0/'+DocId+"?opendocument";
window.open(pathname1+"OpenUrl?Openform&Url="+pathname2,'_blank', 'toolbar=yes, menubar=yes, scrollbars=yes,resizable=yes,location=yes, status=yes,directories=yes')
}
//获得当前时间
function TimeNow()
{
var d, s = "&Time=";
var c = ":";
d = new Date();
s += d.getHours() + c;
s += d.getMinutes() + c;
s += d.getSeconds() + c;
s += d.getMilliseconds();
return(s);
}
//将字符串转换为unicode字符串
function getUnicodeString(sstr){
unicodestr="";
for(i=0;i<sstr.length;i++)
{
unicodestr=unicodestr+sstr.charCodeAt(i)+";";
}
return unicodestr;
}
//取给定字符串中给定子串左边的部分
function strleft(s1,s2){
pos=s1.indexOf(s2)
if(pos!=-1){
return s1.substring(0,pos);
}
else
{return "";
}
}
//取给定字符串中给定子串右边的部分
function strright(s1,s2){
pos=s1.indexOf(s2)
if(pos!=-1){
return s1.substring(pos+1,s1.length);
}
else
{return "";
}
}
//字符串s1是否以字符串s2开始
function isBegin(s1,s2){
if (s1.indexOf(s2)==0){
return true;
}
else
{
return false;
}
}
//压掉字符串中的空格
function trim(s1){
re = / /g;
return s1.replace(re, "");
}
//处理意见内容中的回车
function FormatEnterCharacter(IdeaContent){
var Str = "";
var locate = 0;
var haveNum = 0;
while (IdeaContent != ""){
locate = IdeaContent.indexOf("#ENTER#");
if (locate != -1){
haveNum += 1;
Str += IdeaContent.substring(0,locate) + "<br>";
IdeaContent = IdeaContent.substring(locate + 7,IdeaContent.length);
}
else {
if (haveNum > 0){
Str += IdeaContent + "<br>";
}
else {
Str += IdeaContent;
}
IdeaContent = "";
}
}
return Str;
}
//填写意见
function TianXieYiJian(){
var thisform = document.forms[0];
var pathname = (window.location.pathname);
var docunid = thisform.SelfID.value;
var loginuser = getUnicodeString(thisform.LoginUser.value);
var newWindowUrl = pathname.substring(0,(pathname.lastIndexOf('.nsf')+5))+'QQWriteIdea?OpenForm&DocID='+docunid+'&User='+loginuser;
Left1 = (window.screen.width-500)/2;
Top1 = (window.screen.height-400)/2;
window.open(newWindowUrl,'','status=no,resizable=no,scrollbars=no,width=500,height=420,left='+Left1+',top='+Top1)
}