function submitwin(){
ss = objframe.tree.getselecttext("03");
if (objframe.tree){
dialogArguments.iproductmodel = oldmid;
if(objframe.tree.checkselectall() && oldmid == '2'){
re = /,/g; // 创建正则表达式模式。
r = ss.replace(re, ",\n"); // 替换。
}else{
re = /,/g; // 创建正则表达式模式。
r = ss.replace(re, ",\n"); // 替换。
}
if(oldmid == "10"){
dialogArguments.iproductname = objframe.tree.getnodetext("03");
}else if (showone == "1"){
dialogArguments.iproductname = objframe.tree.getnodetext("03");
dialogArguments.iproductvalue = objframe.tree.getselectid("03");
}else{
dialogArguments.iproductname = r;//objframe.tree.getselecttext();
dialogArguments.iproductvalue = objframe.tree.getselectid("03");
}
}
returnValue = true;
window.close();
}看不太懂,谁帮忙解释下,谢谢了。。重点是正则表达式那
ss = objframe.tree.getselecttext("03");
if (objframe.tree){
dialogArguments.iproductmodel = oldmid;
if(objframe.tree.checkselectall() && oldmid == '2'){
re = /,/g; // 创建正则表达式模式。
r = ss.replace(re, ",\n"); // 替换。
}else{
re = /,/g; // 创建正则表达式模式。
r = ss.replace(re, ",\n"); // 替换。
}
if(oldmid == "10"){
dialogArguments.iproductname = objframe.tree.getnodetext("03");
}else if (showone == "1"){
dialogArguments.iproductname = objframe.tree.getnodetext("03");
dialogArguments.iproductvalue = objframe.tree.getselectid("03");
}else{
dialogArguments.iproductname = r;//objframe.tree.getselecttext();
dialogArguments.iproductvalue = objframe.tree.getselectid("03");
}
}
returnValue = true;
window.close();
}看不太懂,谁帮忙解释下,谢谢了。。重点是正则表达式那
解决方案 »
- JavaScript的innerHTML问题
- JavaScript 的正则匹配的替换绝对路径为相对路径
- js问题
- 如何实现 ASP 调用横向排列后可以自动换行?
- JAVASCRIPT如何跟据客户机的屏幕分辨率来确定背景图片和FLASH的大小?
- document.write问题,IE执行到这就不再继续了
- javascript与JSP可以互相调用吗?
- 哪位大侠有用javascript写的树形代码,能动态添加的那种?
- 请教各位前辈,如何在javascript中调用Word?谢谢!(在线等待中)
- vbscript与javascript
- 利用swfupload实现缩略图片再上传?
- $$$$$枯井 VS $$$$$非哥
function submitwin(){
ss = objframe.tree.getselecttext("03");
if (objframe.tree){
dialogArguments.iproductmodel = oldmid;
if(objframe.tree.checkselectall() && oldmid == '2'){
re = /,/g; // 创建正则表达式模式。
r = ss.replace(re, ",\n"); // 替换。
}else{
re = /,/g; // 创建正则表达式模式。
r = ss.replace(re, ",\n"); // 替换。
}
if(oldmid == "10"){
dialogArguments.iproductname = objframe.tree.getnodetext("03");
}else if (showone == "1"){
dialogArguments.iproductname = objframe.tree.getnodetext("03");
dialogArguments.iproductvalue = objframe.tree.getselectid("03");
}else{
dialogArguments.iproductname = r;//objframe.tree.getselecttext();
dialogArguments.iproductvalue = objframe.tree.getselectid("03");
}
}
returnValue = true;
window.close();
} 逗号加换行符替换逗号。
不懂你要干什么,两个正则怎么是一样的?
if(objframe.tree.checkselectall() && oldmid == '2'){
re = /,/g; // 创建正则表达式模式。
r = ss.replace(re, ",\n"); // 将逗号替换为逗号换行,即从每个逗号后边另起一行。
/*
a,b,c
替换后为
a,
b,
c
*/
}else{
re = /,/g; // 创建正则表达式模式。
r = ss.replace(re, ",\n"); // 替换。
}
http://download.csdn.net/source/308916DHTML参考手册.rar
http://download.csdn.net/source/308913样式表中文手册.chm
http://download.csdn.net/source/304124