??xml version="1.0" encoding="utf-8" standalone="yes"?>
比如我想要设定日志保存在webapp/log
参考了(jin)|上资料Q?span class="Apple-converted-space">
http://hi.baidu.com/suofang/blog/item/6cf2befbd1ff07234f4aea90.html
下面是引入内容:(x)
Ҏ(gu)一主要是扩展了(jin)log4j的RollingFileAppenderc,其他的FileAppender同样道理。扩展的Ҏ(gu)Q就是用一个子cd覆盖setFileҎ(gu)Q这个方法在log4jd配置文g生成appender的时候调用,传入的就是配|文件中的\径,q样我就可以按照自己的想法在路径前面加上根\径了(jin)。这U方法可以在log4j.properties中用相对路径自由配置log4j.appender.A1.File属性来军_生成的日志相对web应用根目录的位置?span class="Apple-converted-space">
Ҏ(gu)二是利用服务器vm中已l存在的环境变量?{catalina.home}来设|相对于${catalina.home}的日志\径,日志只能攑ֈ服务器子目录里,而且如果是用的其它服务器Q则要改对应的环境变量。此Ҏ(gu)q_UL不方ѝ?span class="Apple-converted-space">
Ҏ(gu)三是扩展ActionServletc,覆盖其init()Ҏ(gu)Q新Ҏ(gu)中蝲?span class="hilite1" style="background-color: rgb(255,255,0)">log4j.properties位置的参敎ͼ可以自由配置log4j的配|文件的名字和存放位|。也可自由配|?span class="hilite1" style="background-color: rgb(255,255,0)">log4j日志文g的相对于当前应用的\径?span class="Apple-converted-space">
对于W三个方法,作者提Z(jin)个问题:(x)
log4j配置文g的位|,不让其在web-inf/classes目录Q因为在加蝲此Servlet之前Q服务器如tomcat启动时会(x)自动搜烦(ch)web-inf目录?span class="hilite2" style="background-color: rgb(85,255,85)">web-inf/classes目录?span class="hilite1" style="background-color: rgb(255,255,0)">log4j.properties文gQ如有则自动加蝲?span class="hilite1" style="background-color: rgb(255,255,0)">log4j属性文件加载后,׃该属性文件中log4j.appender.A1.File的值用的是相对路径Q自动加载配|便?x)出错?x)
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: WEB-INF\logs\bysxxglxt.log
(pȝ找不到指定的路径?
管后面加蝲扩展的ActionServlet中正设|了(jin)log4j属性文件ƈ正常加蝲?jin),但还是报的这个错Q怪不爽的。只有更?span class="hilite1" style="background-color: rgb(255,255,0)">log4j属性文件名字或者更改其存放位置Q让其不能自动加载了(jin)Q不q还是有两个警告Q?span class="Apple-converted-space">
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
新的发现Q?span class="Apple-converted-space">
׃spring也会(x)加蝲log4j.propertiesQ如果加载不到就往控制台打log信息Q总觉得有些碍|于是惛_法去掉。Spring提供?jin)一个Log4jConfigListenerQ本w就能通过web.xml中配|来指定位置加蝲log4j配置文g和log输出路径Q注意该listener需要放在spring的Listener之前?span class="Apple-converted-space">
事实上,Log4jConfigListener更适合log4j在web工程中用,原因如下Q?span class="Apple-converted-space">
1. 动态的改变记录U别和策略,不需要重启Web应用Q如《Effective Enterprise Java》所说?span class="Apple-converted-space">
2. 把log文g定在 /WEB-INF/logs/ 而不需要写l对路径?span class="Apple-converted-space">
因ؓ(f) pȝ把web目录的\径压入一个叫webapp.root的系l变量。这样写log文g路径时不用写l对路径?
log4j.appender.logfile.File=${webapp.root}/WEB-INF/logs/myfuse.log
3. 可以?span class="hilite1" style="background-color: rgb(255,255,0)">log4j.properties和其他properties一h?WEB-INF/ Q而不是Class-Path?span class="Apple-converted-space">
4.log4jRefreshInterval?0000表示 开一条watchdogU程?0U扫描一下配|文件的变化;
在web.xml d
opacity
是CSS 3里的一个属性,用来讑֮元素的透明度。当然现在还只有部分浏览器支持?/p>
不过各个览器都有自qU有属性来支持,其中包括老版本的Mozilla和SafariQ?/p>
filter:alpha(opacity)
-moz-opacity
-khtml-opacity
很不q的是,你没看见OperaQ老版本的Operaq没有什么私有属性可以代?code style="padding-right: 2px; padding-left: 2px; font-size: 12px; padding-bottom: 1px; color: rgb(102,51,0); padding-top: 1px">opacity。(新版Opera已经支持opacity
Q?/p>
所以以前用CSS讑֮一个元素半透明的话Q可能会(x)q样?
用javascript来设定一个元素ؓ(f)半透明:
var ImgAlt = new Array();//鼠标放上LC的文字
ImgAlt[0] = "国《国家地理杂志?"
ImgAlt[1] = "国《国家地理杂志?"
ImgAlt[2] = "国《国家地理杂志?"
ImgAlt[3] = "国《国家地理杂志?"
ImgAlt[4] = "国《国家地理杂志?"
ImgAlt[5] = "国《国家地理杂志?"
ImgAlt[6] = "国《国家地理杂志?"
ImgAlt[7] = "国《国家地理杂志?"
var ImgHerf = (tng) new Array();//链接
ImgHerf[0] = "ImgHerf[1] = "ImgHerf[2] = "http://www.12free.cn/kelven/mypic/Usa_geography/pic2006/page_03.htm"
ImgHerf[3] = "ImgHerf[4] = "ImgHerf[5] = "ImgHerf[6] = "ImgHerf[7] = "http://www.12free.cn/kelven/mypic/Usa_geography/pic2006/page_08.htm"
var step=0;
function slideit(){
(tng)var oImg = document.getElementById("javascript.img");
(tng)if (document.all){oImg.filters.blendTrans.apply();}
(tng)oImg.src=ImgSrc[step];
(tng)document.getElementById("javascript.a").href=ImgHerf[step];
(tng)oImg.title=ImgAlt[step];
(tng)if (document.all){oImg.filters.blendTrans.play();}
(tng)step = (step<(ImgSrc.length-1))?(step+1):0;
(tng)(new Image()).src = ImgSrc[step];//加蝲下一个图?br />}
setInterval("slideit()",3000);
//-->
</script>
</body>
</html>
.xWin {
(tng)position:absolute;
(tng)cursor:default;
(tng)border-width:2px;
(tng)border-style:outset;
(tng)padding:0px;
(tng)font-size:12px;
(tng)overflow:hidden;
(tng)display:block;
}
.xWin .xWinSetting {
(tng)display:none;
}
.xWin .xTitle {
(tng)color:#FFFFFF;
(tng)height:20px;
(tng)display:block;
}
.xWin .xTitle input {
(tng)background-color:transparent;
(tng)color:#FFFFFF;
(tng)border-width:0px;
(tng)border-style:solid;
(tng)height:20px;
(tng)width:16px;
(tng)line-height:20px;
(tng)font-family:webdings;
(tng)font-size:10px;
(tng)margin:0px;
(tng)padding:0px;
(tng)text-align:center;
(tng)float:right;
(tng)display:block;
}
.xWin .xTitle .xWinTitleCloseButton {
(tng)
}
.xWin .xTitle .xWinTitleMaxButton {
(tng)
}
.xWin .xTitle .xWinTitleMinButton {
(tng)
}
.xWin .xTitle .xWinTitleContent {
(tng)color:#FFFFFF;
(tng)font-size:12px;
(tng)height:18px;
(tng)line-height:20px;
(tng)margin:0px;
(tng)padding-left:3px;
(tng)float:left;
(tng)display:block;
(tng)overflow:hidden;
(tng)white-space:nowrap;
(tng)text-align:left;
(tng)cursor:default;
}
.xWin .xWinBody {
(tng)margin:0px;
(tng)background-color:#FFFFFF;
(tng)color:#000000;
(tng)padding:3px;
(tng)font-size:12px;
(tng)overflow:auto;
(tng)position:relative;
(tng)display:block;
}
.xShadow {
(tng)position:absolute;
(tng)display:block;
(tng)background-Color:#000000;
(tng)color:#FFFFFF;
}
</style>
<script type="text/javascript">
//<![CDATA[
//********************/
// (tng) x pd?xWin
// (tng) 作者:(x)Hutia
// (tng) 未经同意不得转蝲或用于商业用?br />//********************/
/*
说明Q?br /> (tng) xpd是Hutia开发的pdJS代码Q配合相应的css后可以实现快速的自定义标{?br /> (tng) 目前xpd支持的浏览器cd为:(x)IE5.5, FF1.5
(tng) xWin的标{ؓ(f) <div class="xwin">content</div>
(tng) 支持属性:(x)
(tng) (tng) (tng) int left, int top, int width, int height
(tng) 支持Ҏ(gu)Q?br /> (tng) (tng) (tng) Close(), Destroy(), Max([bolean Variable]), Min([bolean Variable]),
(tng) (tng) (tng) MoveTo(int x, int y), ResizeTo(int x, int y), SetContent(string Variable | htmlObject Variable)
(tng)SetTitle(string Variable), ShowHide()
*/
//**载入CSS*****
var xWinCssFilePath="sp\/css\/xwin.css";
//document.write("<style>@import url("+xWinCssFilePath+");</style>");
//**(g)浏览器U类*****
var BROWSERNAME="";
switch(navigator.appName.toLowerCase()){
(tng)case "netscape":
(tng) (tng)BROWSERNAME="ns";
(tng)break;
(tng)case "microsoft internet explorer":
(tng)default:
(tng) (tng)BROWSERNAME="ie";
(tng)break;
}
//**讄初始化变?*****
switch(BROWSERNAME){
(tng)case "ns":
(tng) (tng)window.addEventListener("load",_xWin_init,false);
(tng)break;
(tng)case "ie":
(tng)default:
(tng) (tng)window.attachEvent("onload",_xWin_init);
}
//**讄全局定时?*****
if(typeof(__xSeriaTimer__)=="undefined"){
(tng)var __xSeriaTimer__={
(tng) (tng)events:new Array(),
(tng) (tng)objs:new Array(),
(tng) (tng)handle:null,
(tng) (tng)exec:function(){
(tng) (tng) (tng)for(var i=0;i<__xSeriaTimer__.events.length;i++){
(tng) (tng) (tng) (tng)try{
(tng) (tng) (tng) (tng) (tng)with(__xSeriaTimer__.objs[i]){
(tng) (tng) (tng) (tng) (tng) (tng)eval(__xSeriaTimer__.events[i]);
(tng) (tng) (tng) (tng) (tng)}
(tng) (tng) (tng) (tng)}catch(e){}
(tng) (tng) (tng)}
(tng) (tng)},
(tng) (tng)pop:function(i){
(tng) (tng) (tng)__xSeriaTimer__.events[i]=null;
(tng) (tng) (tng)__xSeriaTimer__.objs[i]=null;
(tng) (tng)},
(tng) (tng)push:function(strV,obj){
(tng) (tng) (tng)for(var i=0;i<__xSeriaTimer__.events.length;i++){
(tng) (tng) (tng) (tng)if(__xSeriaTimer__.events[i]==null){
(tng) (tng) (tng) (tng) (tng)__xSeriaTimer__.events[i]=strV;
(tng) (tng) (tng) (tng) (tng)__xSeriaTimer__.objs[i]=obj;
(tng) (tng) (tng) (tng) (tng)return(i);
(tng) (tng) (tng) (tng)}
(tng) (tng) (tng)}
(tng) (tng) (tng)__xSeriaTimer__.events[i]=strV;
(tng) (tng) (tng)__xSeriaTimer__.objs[i]=obj;
(tng) (tng) (tng)return(i);
(tng) (tng)},
(tng) (tng)start:function(){
(tng) (tng) (tng)__xSeriaTimer__.stop();
(tng) (tng) (tng)__xSeriaTimer__.handle=setInterval(__xSeriaTimer__.exec,30);
(tng) (tng)},
(tng) (tng)stop:function(){
(tng) (tng) (tng)clearInterval(__xSeriaTimer__.handle);
(tng) (tng)}
(tng)};
(tng)__xSeriaTimer__.start();
}
//**初始化函?*****
function _xWin_init(){
(tng)var allTheWindows=document.getElementsByTagName("div");
(tng)for(var i=0;i<allTheWindows.length;i++){
(tng) (tng)if(allTheWindows[i].className=="xWin")_xWin_event_doInit(allTheWindows[i]);
(tng)}
}
//**事g响应函数?*****
function _xWin_event_doInit(element){
(tng)//初始化变?br /> (tng)element.ownerDocument.index=isNaN(element.ownerDocument.index)?10000:parseInt(element.ownerDocument.index)+1;
(tng)element.x0=0;element.y0=0;
(tng)element.x1=0;element.y1=0;
(tng)element.w0=0;element.h0=0;
(tng)element.offx=6;element.offy=6;
(tng)element.padx=0;element.pady=0;
(tng)element.minW=90;element.minH=(BROWSERNAME=="ns"?20:20);
(tng)element.moveable=false;
(tng)element.resizable=false;
(tng)element.hover='orange';element.normal='#336699';
(tng)element.minButton=BROWSERNAME=="ie"?"0":"_";
(tng)element.maxButton=BROWSERNAME=="ie"?"1":"=";
(tng)element.normalButton=BROWSERNAME=="ie"?"2":"+";
(tng)element.closeButton=BROWSERNAME=="ie"?"r":"X";
(tng)element._title="Untitled Window";
(tng)element._body="";
(tng)element._winRect={l:0,t:0,w:0,h:0};
(tng)element._restoredWinRect={l:0,t:0,w:0,h:0};
(tng)element._windowState="normal";
(tng)element.settingNode=getElementByClassName(element,"xWinSetting");
(tng)if(!element.settingNode){
(tng) (tng)element.settingNode=document.createElement("div");
(tng) (tng)element.settingNode.className="xWinSetting";
(tng) (tng)element.settingNode.xwin=element;
(tng) (tng)element.appendChild(element.settingNode);
(tng)}
(tng)element.xwin=element;
(tng)
(tng)//讄Ҏ(gu)
(tng)element.Close=_xWin_method_Close;
(tng)element.Destroy=_xWin_method_Destroy;
(tng)element.GetSetting=_xWin_method_GetSetting;
(tng)element.Max=_xWin_method_Max;
(tng)element.Min=_xWin_method_Min;
(tng)element.MoveTo=_xWin_method_MoveTo;
(tng)element.ResizeTo=_xWin_method_ResizeTo;
(tng)element.SetContent=_xWin_method_SetContent;
(tng)element.SetTitle=_xWin_method_SetTitle;
(tng)element.ShowHide=_xWin_method_ShowHide;
(tng)
(tng)//讄事g
(tng)element.onmousedown=_xWin_event_doMDown;
(tng)element.onmouseup=element.onlosecapture=_xWin_event_doMUp;
(tng)element.onmousemove=_xWin_event_doMMove;
(tng)element.onclick=_xWin_event_doClick;
(tng)element.onselectstart=element.onselect=_xWin_event_doSelect;
(tng)
(tng)//记录昄风格
(tng)var tempDisplay=element.style.display;
(tng)//改变昄风格
(tng)element.style.display="block";
(tng)//讄H口变量
(tng)var w=parseInt(element.GetSetting("width"));
(tng)w=isNaN(w)?(element.offsetWidth+10):parseInt(w);
(tng)w=w<element.minW?element.minW:w;
(tng)var h=parseInt(element.GetSetting("height"));
(tng)h=isNaN(h)?(element.offsetHeight+30):parseInt(h);
(tng)h=h<element.minH?element.minH:h;
(tng)var l=parseInt(element.GetSetting("left"));
(tng)l=isNaN(l)?element.offsetLeft:parseInt(l);
(tng)l=l<1?1:l;
(tng)var t=parseInt(element.GetSetting("top"));
(tng)t=isNaN(t)?element.offsetTop:parseInt(t);
(tng)t=t<1?1:t;
(tng)var z=element.ownerDocument.index;
(tng)var title=new String(element.GetSetting("title"));
(tng)
(tng)//讄H口标题
(tng)element.oTitle=element.ownerDocument.createElement("div");
(tng)element.oTitle.xwin=element;
(tng)element.oTitle.className="xTitle";
(tng)element.appendChild(element.oTitle);
(tng)
(tng)//讄H口标题内容
(tng)element.oTitleContent=element.ownerDocument.createElement("span");
(tng)element.oTitleContent.xwin=element;
(tng)element.oTitleContent.className="xWinTitleContent";
(tng)element.oTitle.appendChild(element.oTitleContent);
(tng)element.oTitleContent.ondblclick=function(){this.xwin.Max();};
(tng)element.SetTitle(title);
(tng)
(tng)//讄H口标题关闭按钮
(tng)element.oTitleCButton=element.ownerDocument.createElement("input");
(tng)element.oTitleCButton.xwin=element;
(tng)element.oTitleCButton.type="button";
(tng)element.oTitleCButton.className="xWinTitleCloseButton";
(tng)element.oTitle.appendChild(element.oTitleCButton);
(tng)element.oTitleCButton.onclick=function(){this.xwin.ShowHide("none");};
(tng)element.oTitleCButton.value=element.closeButton;
(tng)
(tng)//讄H口标题最大化按钮
(tng)element.oTitleMaButton=element.ownerDocument.createElement("input");
(tng)element.oTitleMaButton.xwin=element;
(tng)element.oTitleMaButton.type="button";
(tng)element.oTitleMaButton.className="xWinTitleMaxButton";
(tng)element.oTitle.appendChild(element.oTitleMaButton);
(tng)element.oTitleMaButton.onclick=function(){this.xwin.Max();};
(tng)element.oTitleMaButton.value=element.maxButton;
(tng)
(tng)//讄H口标题最化按钮
(tng)element.oTitleMButton=element.ownerDocument.createElement("input");
(tng)element.oTitleMButton.xwin=element;
(tng)element.oTitleMButton.type="button";
(tng)element.oTitleMButton.className="xWinTitleMinButton";
(tng)element.oTitle.appendChild(element.oTitleMButton);
(tng)element.oTitleMButton.onclick=function(){this.xwin.Min();};
(tng)element.oTitleMButton.value=element.minButton;
(tng)
(tng)//讄H口内容
(tng)element.oContent=element.ownerDocument.createElement("div");
(tng)element.oContent.xwin=element;
(tng)element.oContent.className="xWinBody";
(tng)element.appendChild(element.oContent);
(tng)oC=element.firstChild;
(tng)while(oC){
(tng) (tng)tC=oC.nextSibling;
(tng) (tng)if(oC!=element.oTitle&&oC!=element.oContent){ (tng) (tng) (tng)
(tng) (tng) (tng)element.oContent.appendChild(oC);
(tng) (tng)}
(tng) (tng)oC=tC;
(tng)}
(tng)
(tng)//讄H口阴媄(jing)
(tng)element.oShadow=element.ownerDocument.createElement("div");
(tng)element.oShadow.xwin=element;
(tng)element.oShadow.className="xShadow";
(tng)element.parentNode.insertBefore(element.oShadow,element.nextSibling);
(tng)element.oShadow.style.zIndex=z-1;
(tng)
(tng)element.MoveTo(l,t);
(tng)element.ResizeTo(w,h);
(tng)
(tng)//恢复昄风格
(tng)element.style.display=tempDisplay;
(tng)//讄H口样式
(tng)with(element.style){
(tng) (tng)zIndex=z;
(tng) (tng)backgroundColor=element.normal;
(tng) (tng)color=element.normal;
(tng)}
(tng)padx=element.offsetWidth-element.clientWidth;
(tng)pady=element.offsetHeight-element.clientHeight;
(tng)
}
function _xWin_event_doMDown(evt){
(tng)var e=evt?evt:window.event;
(tng)var eSrc=e.srcElement?e.srcElement:e.target;
(tng)var leftButton=e.srcElement?e.button==1:e.button==0;
(tng)if(this.style.zIndex!=this.ownerDocument.index){//窗口放到最?br /> (tng) (tng)this.ownerDocument.index+=2;
(tng) (tng)var idx = this.ownerDocument.index;
(tng) (tng)this.style.zIndex=idx;
(tng) (tng)this.nextSibling.style.zIndex=idx-1;
(tng)}
(tng)if(eSrc==this.oTitleContent&&leftButton&&this._windowState=="normal"){//如果开始拖?br /> (tng) (tng)//锁定标题?
(tng) (tng)document.captureEvents?document.captureEvents("mousemove",this.oTitle):this.oTitle.setCapture();
(tng) (tng)//定义对象;
(tng) (tng)var win = this;
(tng) (tng)var sha = win.nextSibling;
(tng) (tng)//记录鼠标和层位置;
(tng) (tng)this.x0 = e.clientX;
(tng) (tng)this.y0 = e.clientY;
(tng) (tng)this.x1 = parseInt(win.style.left);
(tng) (tng)this.y1 = parseInt(win.style.top);
(tng) (tng)//改变风格;
(tng) (tng)this.oTitle.style.backgroundColor = this.hover;
(tng) (tng)win.style.borderColor = this.hover;
(tng) (tng)this.oTitle.nextSibling.style.color = this.hover;
(tng) (tng)sha.style.left = this.x1 + this.offx;
(tng) (tng)sha.style.top (tng) = this.y1 + this.offy;
(tng) (tng)this.moveable = true;
(tng) (tng)return(true);
(tng)}
(tng)if(this.style.cursor!="default"&&this._windowState=="normal"){//开始改变大?br /> (tng) (tng)//锁定标题?
(tng) (tng)document.captureEvents?document.captureEvents("mousemove",this.oTitle):this.oTitle.setCapture();
(tng) (tng)//定义对象;
(tng) (tng)var win = this;
(tng) (tng)var sha = win.nextSibling;
(tng) (tng)//记录鼠标位置和层位置和大?
(tng) (tng)this.x0=e.clientX;
(tng) (tng)this.y0=e.clientY;
(tng) (tng)this.x1=parseInt(win.offsetLeft);
(tng) (tng)this.y1=parseInt(win.offsetTop);
(tng) (tng)this.w0=parseInt(win.offsetWidth);
(tng) (tng)this.h0=parseInt(win.offsetHeight);
(tng) (tng)//改变风格;
(tng) (tng)this.oTitle.style.backgroundColor = this.hover;
(tng) (tng)win.style.borderColor = this.hover;
(tng) (tng)this.oTitle.nextSibling.style.color = this.hover;
(tng) (tng)sha.style.left = this.x1 + this.offx;
(tng) (tng)sha.style.top (tng) = this.y1 + this.offy;
(tng) (tng)this.resizable = true;
(tng) (tng)return(true);
(tng)}
}
function _xWin_event_doMUp(evt){
(tng)var e=evt?evt:window.event;
(tng)document.releaseEvents?document.releaseEvents("mousemove",this.oTitle):this.oTitle.releaseCapture();
(tng)if(this.moveable){
(tng) (tng)var win = this;
(tng) (tng)var sha = win.nextSibling;
(tng) (tng)var msg = this.oTitle.nextSibling;
(tng) (tng)win.style.borderColor (tng) (tng) (tng) (tng) = "";
(tng) (tng)this.oTitle.style.backgroundColor = "";
(tng) (tng)msg.style.color (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) = "";
(tng) (tng)sha.style.left = this.oTitle.parentNode.style.left;
(tng) (tng)sha.style.top (tng) = this.oTitle.parentNode.style.top;
(tng) (tng)this.moveable = false;
(tng) (tng)return(false);
(tng)}
(tng)if(this.resizable){
(tng) (tng)var win = this;
(tng) (tng)var sha = win.nextSibling;
(tng) (tng)var msg = this.oTitle.nextSibling;
(tng) (tng)win.style.borderColor (tng) (tng) (tng) (tng) = "";
(tng) (tng)this.oTitle.style.backgroundColor = "";
(tng) (tng)msg.style.color (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) = "";
(tng) (tng)sha.style.left = this.oTitle.parentNode.style.left;
(tng) (tng)sha.style.top (tng) = this.oTitle.parentNode.style.top;
(tng) (tng)sha.style.width = this.oTitle.parentNode.style.width;
(tng) (tng)sha.style.height = this.oTitle.parentNode.style.height;
(tng) (tng)this.style.cursor="default";
(tng) (tng)this.resizable = false;
(tng) (tng)return(false);
(tng)}
}
function _xWin_event_doMMove(evt){
(tng)var e=evt?evt:window.event;
(tng)if(this.moveable){//拖动H口
(tng) (tng)this.MoveTo(this.x1 + e.clientX - this.x0, this.y1 + e.clientY - this.y0);
(tng) (tng)return(true);
(tng)}
(tng)if(this.resizable){//改变H口大小
(tng) (tng)var xxx=this.style.cursor.substring(0,2).match(/[we]/i);
(tng) (tng)var yyy=this.style.cursor.substring(0,2).match(/[ns]/i);
(tng) (tng)l=this.offsetLeft;
(tng) (tng)t=this.offsetTop;
(tng) (tng)w=parseInt(this.style.width);
(tng) (tng)h=parseInt(this.style.height);
(tng) (tng)if(xxx=="w"){
(tng) (tng) (tng)l=this.x1+e.clientX - this.x0;
(tng) (tng) (tng)w=this.w0+this.x0-e.clientX;
(tng) (tng) (tng)if(l<0){w+=l;l=0;}
(tng) (tng) (tng)if(w<this.minW){l=l+w-this.minW;w=this.minW;}
(tng) (tng)}
(tng) (tng)if(xxx=="e"){
(tng) (tng) (tng)w=this.w0+e.clientX-this.x0;
(tng) (tng) (tng)w=w<this.minW?this.minW:w;
(tng) (tng)}
(tng) (tng)if(yyy=="n"){
(tng) (tng) (tng)t=this.y1+e.clientY - this.y0;
(tng) (tng) (tng)h=this.h0+this.y0-e.clientY;
(tng) (tng) (tng)if(t<0){h+=t;t=0;}
(tng) (tng) (tng)if(h<this.minH){t=t+h-this.minH;h=this.minH;}
(tng) (tng)}
(tng) (tng)if(yyy=="s"){
(tng) (tng) (tng)h=this.h0+e.clientY-this.y0;
(tng) (tng) (tng)h=h<this.minH?this.minH:h;
(tng) (tng)}
(tng) (tng)this.MoveTo(l,t);
(tng) (tng)this.ResizeTo(w,h);
(tng) (tng)
(tng) (tng)return(true);
(tng)}
(tng)if(this._windowState=="normal"){
(tng) (tng)var cc="";
(tng) (tng)x=window.getRealLeft(this);
(tng) (tng)y=window.getRealTop(this);
(tng) (tng)w=parseInt(this.offsetWidth);
(tng) (tng)h=parseInt(this.offsetHeight);
(tng) (tng)if(e.clientY-y<5)cc+="n";
(tng) (tng)if(y+h-e.clientY<5)cc+="s";
(tng) (tng)if(e.clientX-x<5)cc+="w";
(tng) (tng)if(x+w-e.clientX<5)cc+="e";
(tng) (tng)if(cc!=""){
(tng) (tng) (tng)this.style.cursor=cc+"-resize";
(tng) (tng) (tng)return(true);
(tng) (tng)}
(tng) (tng)if(this.style.cursor!="default"){
(tng) (tng) (tng)this.style.cursor="default";
(tng) (tng)}
(tng)}
}
function _xWin_event_doClick(evt){
(tng)var e=evt?evt:window.event;
(tng)var eSrc=e.srcElement?e.srcElement:e.target;
(tng)switch(eSrc){
(tng) (tng)
(tng)}
}
function _xWin_event_doSelect(evt){
(tng)var e=evt?evt:window.event;
(tng)var eSrc=e.srcElement?e.srcElement:e.target;
(tng)if(eSrc==this.oTitle||this.oTitle.contains(eSrc)){
(tng) (tng)e.cancelBubble=true;
(tng) (tng)e.returnValue=false;
(tng) (tng)return(false);
(tng)}
}
function _xWinParentNode_event_doScroll(evt){
(tng)if(!this.minimizedWindows)return(true);
(tng)for(var i=0;i<this.minimizedWindows.length;i++){
(tng) (tng)this.minimizedWindows[i].Min(true);
(tng)}
}
(tng)
//**Ҏ(gu)函数?*****
function _xWin_method_Close(){
(tng)this.Destroy();
}
function _xWin_method_Destroy(){
(tng)if(this.minIndex){
(tng) (tng)this.parentNode.minimizedWindows[this.minIndex]=null;
(tng) (tng)this.minIndex=null;
(tng)}
(tng)this.outerHTML="";
}
function _xWin_method_GetSetting(attributeName){
(tng)var settingString=this.settingNode.innerHTML;
(tng)if(!attributeName)return(settingString);
(tng)var regE=new RegExp(attributeName+"=[ \t]*\"?([^\"]*)","i");
(tng)var re=settingString.match(regE);
(tng)if(re){
(tng) (tng)return(re[1]);
(tng)}else{
(tng) (tng)return(re);
(tng)}
}
function _xWin_method_Max(reV){
(tng)if(this._windowState=="maximize"&&(!reV)){
(tng) (tng)//q原父节点overflow属?br /> (tng) (tng)this.parentNode.style.overflow=this.parentNode.restoredStyle_overflow;
(tng) (tng)
(tng) (tng)this.MoveTo(this._restoredWinRect.l,this._restoredWinRect.t);
(tng) (tng)this.ResizeTo(this._restoredWinRect.w,this._restoredWinRect.h);
(tng) (tng)this.oTitleMButton.value = this.minButton;
(tng) (tng)this.oTitleMaButton.value = this.maxButton;
(tng) (tng)this._windowState="normal";
(tng)}else{
(tng) (tng)if(this._windowState=="normal"){
(tng) (tng) (tng)this._restoredWinRect.l=this._winRect.l;this._restoredWinRect.t=this._winRect.t;
(tng) (tng) (tng)this._restoredWinRect.w=this._winRect.w;this._restoredWinRect.h=this._winRect.h;
(tng) (tng)}
(tng) (tng)if(this.minIndex!=null){
(tng) (tng) (tng)this.parentNode.minimizedWindows[this.minIndex]=null;
(tng) (tng) (tng)this.minIndex=null;
(tng) (tng)}
(tng) (tng)if(this.minTimeHandle!=null){
(tng) (tng) (tng)__xSeriaTimer__.pop(this.minTimeHandle);
(tng) (tng) (tng)this.minTimeHandle=null;
(tng) (tng)}
(tng) (tng)//U录父节点overflow属?br /> (tng) (tng)this.parentNode.restoredStyle_overflow=this.parentNode.style.overflow;
(tng) (tng)//改变父节点overflow属?br /> (tng) (tng)this.parentNode.style.overflow="hidden";
(tng) (tng)
(tng) (tng)this.MoveTo(0,0);
(tng) (tng)if(this.parentNode!=document.body){
(tng) (tng) (tng)w=this.parentNode.clientWidth-5;
(tng) (tng) (tng)h=this.parentNode.clientHeight-4;
(tng) (tng)}else{
(tng) (tng) (tng)w=document.documentElement.clientWidth-5;
(tng) (tng) (tng)h=document.documentElement.clientHeight-4;
(tng) (tng)}
(tng) (tng)this.ResizeTo(w,h);
(tng) (tng)this.oTitleMButton.value = this.minButton;
(tng) (tng)this.oTitleMaButton.value = this.normalButton;
(tng) (tng)this._windowState="maximize";
(tng) (tng)this.scrollIntoView();
(tng)}
}
function _xWin_method_Min(reV){
(tng)if(this._windowState=="minimize"&&(!reV)){
(tng) (tng)this.MoveTo(this._restoredWinRect.l,this._restoredWinRect.t);
(tng) (tng)this.ResizeTo(this._restoredWinRect.w,this._restoredWinRect.h);
(tng) (tng)this.oTitleMButton.value = this.minButton;
(tng) (tng)this.oTitleMaButton.value = this.maxButton;
(tng) (tng)this._windowState="normal";
(tng) (tng)this.parentNode.minimizedWindows[this.minIndex]=null;
(tng) (tng)this.minIndex=null;
(tng) (tng)if(this.minTimeHandle!=null){
(tng) (tng) (tng)__xSeriaTimer__.pop(this.minTimeHandle);
(tng) (tng) (tng)this.minTimeHandle=null;
(tng) (tng)}
(tng)}else{
(tng) (tng)if(this._windowState=="normal"){
(tng) (tng) (tng)this._restoredWinRect.l=this._winRect.l;this._restoredWinRect.t=this._winRect.t;
(tng) (tng) (tng)this._restoredWinRect.w=this._winRect.w;this._restoredWinRect.h=this._winRect.h;
(tng) (tng)}else{
(tng) (tng) (tng)//q原父节点overflow属?br /> (tng) (tng) (tng)try{
(tng) (tng) (tng) (tng)this.parentNode.style.overflow=this.parentNode.restoredStyle_overflow;
(tng) (tng) (tng)}catch(e){}
(tng) (tng)}
(tng) (tng)if(!this.parentNode.minimizedWindows)this.parentNode.minimizedWindows=new Array();
(tng) (tng)if(this._windowState!="minimize"){
(tng) (tng) (tng)for(var i=0;i<this.parentNode.minimizedWindows.length;i++){
(tng) (tng) (tng) (tng)if(this.parentNode.minimizedWindows[i]==null)break;
(tng) (tng) (tng)}
(tng) (tng) (tng)this.parentNode.minimizedWindows[i]=this;
(tng) (tng)}else{
(tng) (tng) (tng)i=this.minIndex;
(tng) (tng)}
(tng) (tng)this.ResizeTo(0,0);
(tng) (tng)var w=this.offsetWidth;
(tng) (tng)var h=this.offsetHeight;
(tng) (tng)var mw=getParentRect(this).mw;
(tng) (tng)var mh=getParentRect(this).mh;
(tng) (tng)var n=parseInt(mw/w);
(tng) (tng)var t=parseInt(i/n)+1;
(tng) (tng)this.MoveTo(w*(i%n),mh-t*h-1);
(tng) (tng)if(mh>getParentRect(this).mh){
(tng) (tng) (tng)this.MoveTo(w*(i%n),mh-t*h-200);
(tng) (tng) (tng)mh=getParentRect(this).mh;
(tng) (tng) (tng)this.MoveTo(w*(i%n),mh-t*h-1);
(tng) (tng)}
(tng) (tng)this.minIndex=i;
(tng) (tng)this.oTitleMButton.value = this.normalButton;
(tng) (tng)this.oTitleMaButton.value = this.maxButton;
(tng) (tng)this._windowState="minimize";
(tng) (tng)if(this.minTimeHandle==null){
(tng) (tng) (tng)this.minTimeHandle=__xSeriaTimer__.push("Min(true)",this);
(tng) (tng) (tng)this.scrollIntoView();
(tng) (tng)}
(tng)}
}
function _xWin_method_MoveTo(x,y){
(tng)var win = this.oTitle.parentNode;
(tng)var sha = win.nextSibling;
(tng)
(tng)x=isNaN(x)?0:parseInt(x);
(tng)y=isNaN(y)?0:parseInt(y);
(tng)x=x<0?0:x;
(tng)y=y<0?0:y;
(tng)this.style.left=x+"px";
(tng)this.style.top=y+"px";
(tng)
(tng)sha.style.left = parseInt(win.style.left) + ((this.moveable||this.resizable)?this.offx:0)+"px";
(tng)sha.style.top (tng) = parseInt(win.style.top) + ((this.moveable||this.resizable)?this.offy:0)+"px";
(tng)this._winRect.l=x;
(tng)this._winRect.t=y;
}
function _xWin_method_ResizeTo(w,h){
(tng)var win = this;
(tng)var sha = win.nextSibling;
(tng) (tng)
(tng)var w=isNaN(w)?this.minW:parseInt(w);
(tng)var h=isNaN(h)?this.minH:parseInt(h);
(tng)var w=w<this.minW?this.minW:w;
(tng)var h=h<this.minH?this.minH:h;
(tng)
(tng)this.style.width=w+"px";
(tng)this.style.height=h+"px";
(tng)this.oTitle.style.width=parseInt(this.clientWidth)+"px";
(tng)var wTC=this.clientWidth;
(tng)for(var i=0;i<this.oTitle.childNodes.length;i++){
(tng) (tng)if(this.oTitle.childNodes[i]!=this.oTitleContent){wTC-=this.oTitle.childNodes[i].offsetWidth;}
(tng)}
(tng)wTC-=8;
(tng)this.oTitleContent.style.width=(wTC<1?1:wTC)+"px";
(tng)
(tng)var wC=this.clientHeight-this.oTitle.offsetHeight-6;
(tng)this.oContent.style.height=(wC<1?1:wC)+"px";
(tng)this.oContent.style.width=parseInt(this.clientWidth-6)+"px";
(tng)sha.style.left = parseInt(win.style.left) + ((this.moveable||this.resizable)?this.offx:0)+"px";
(tng)sha.style.top (tng) = parseInt(win.style.top) + ((this.moveable||this.resizable)?this.offy:0)+"px";
(tng)sha.style.width = parseInt(win.style.width)+"px";
(tng)sha.style.height = parseInt(win.style.height)+"px";
(tng)
(tng)this._winRect.w=w;
(tng)this._winRect.h=h;
}
function _xWin_method_SetContent(v){
(tng)if(this.oContent){
(tng) (tng)if(v==null||v==undefined||v==""){this._body=this.oContent.innerHTML="";return(this.oContent);}
(tng) (tng)if(typeof(v)=="string"){
(tng) (tng) (tng)this._body=this.oContent.innerHTML=v;
(tng) (tng) (tng)return(this.oContent);
(tng) (tng)}else{
(tng) (tng) (tng)try{
(tng) (tng) (tng) (tng)this.oContent.innerHTML="";
(tng) (tng) (tng) (tng)this._body=this.oContent.appendChild(v);
(tng) (tng) (tng) (tng)return(this.oContent);
(tng) (tng) (tng)}catch(e){
(tng) (tng) (tng) (tng)throw(e);
(tng) (tng) (tng)}
(tng) (tng)}
(tng)}else{
(tng) (tng)this._body=v;
(tng) (tng)return(null);
(tng)}
}
function _xWin_method_SetTitle(strT){
(tng)this._title=strT==null?this._title:strT;
(tng)if(this.oTitleContent){
(tng) (tng)setInnerText(this.oTitleContent,this._title);
(tng)}
}
function _xWin_method_ShowHide(dis){
(tng)var bdisplay = (dis==null)?((this.style.display=="none")?"":"none"):dis;
(tng)this.style.display = bdisplay;
(tng)this.nextSibling.style.display = bdisplay;
(tng)if(bdisplay=="none"){
(tng) (tng)if(this._windowState=="minimize"){
(tng) (tng) (tng)this.parentNode.minimizedWindows[this.minIndex]=null;
(tng) (tng) (tng)this.minIndex=null;
(tng) (tng)}
(tng)}else{
(tng) (tng)if(this._windowState=="minimize"){
(tng) (tng) (tng)this.Min();
(tng) (tng)}
(tng)}
}
//**通用函数?**
function getRealLeft(o){
(tng)var l=o.offsetLeft-o.scrollLeft;
(tng)while(o=o.offsetParent){
(tng) (tng)l+=o.offsetLeft-o.scrollLeft;
(tng)}
(tng)return(l);
}
function getRealTop(o){
(tng)var t=o.offsetTop-o.scrollTop;
(tng)while(o=o.offsetParent){
(tng) (tng)t+=o.offsetTop-o.scrollTop;
(tng)}
(tng)return(t);
}
function setInnerText(obj,text){
(tng)switch(BROWSERNAME){
(tng) (tng)case "ns":
(tng) (tng) (tng)obj.textContent=text;
(tng) (tng)break;
(tng) (tng)case "ie":
(tng) (tng)default:
(tng) (tng) (tng)obj.innerText=text;
(tng)}
}
function getElementByClassName(obj,className){
(tng)for(var i=0;i<obj.childNodes.length;i++){
(tng) (tng)if(obj.childNodes[i].className==className)return(obj.childNodes[i]);
(tng)}
(tng)return(null);
}
function getParentRect(obj){
(tng)var re=new Object();
(tng)if(obj.parentNode!=document.body){
(tng) (tng)re.mw=Math.max(obj.parentNode.scrollWidth,obj.parentNode.clientWidth);
(tng) (tng)re.mh=Math.max(obj.parentNode.scrollHeight,obj.parentNode.clientHeight);
(tng)}else{
(tng) (tng)re.mw=Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth);
(tng) (tng)re.mh=Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight);
(tng)}
(tng)return(re);
} (tng)
//]]>
</script>
</head>
<body>
<div class="xWin" id="win1" >
(tng)<span class="xWinSetting">width="400" height="400" top="300" left="100" title="我就是传说中那个长的窗口标?</span>
(tng)我就是传说中那个长的窗口标题我是传说
(tng)<div class="xWin" id="win30" >
(tng) (tng)<span class="xWinSetting"> width="100" top="20" left="20" title="我就是传说中那个长的窗口标?</span>
(tng) (tng)中那个超长的H口标题我就是传说中那个?lt;br/>长的H口标题我就是传说中那个长
(tng)</div>
(tng)的窗口标题我是传说中那个超长的H口标题我就是传说中那个长的窗口标题我是传说中那个超长的H口标题
(tng)我就是传说中那个长?br /> (tng)<div class="xWin" id="win31" >
(tng) (tng)<span class="xWinSetting">width="100" top="40" left="40" title="我就是传说中那个长的窗口标? </span>
(tng) (tng)中那个超长的H口标题我就是传说中那个?lt;br/>长的H口标题我就是传说中那个长
(tng)</div>
(tng)H口标题我就是传说中?br /> (tng)个超长的H口标题我就是传说中那个长的窗口标题我是传说中那个超长的H口标题我就是传说中?br /> (tng)个超长的H口标题我就是传说中那个长的窗口标?br /> (tng)c<br/>
(tng)12345
</div>
<div class="xWin" id="win2">
(tng)<span class="xWinSetting"> width="200" top="270" left="140" title="我就是传说中那个长的窗口标?</span>
(tng)我是H口2<br/>
(tng)我是H口2<br/>
(tng)我是H口2<br/>
(tng)我是H口2<br/>
(tng)<a href="javascript:void(0);">更换标题</a>
(tng)我是H口2<br/>
(tng)我是H口2<br/>
(tng)我是H口2<br/>
(tng)我是H口2<br/>
</div>
<a href="javascript:win1.ShowHide('');void(0);">win1</a>
<a href="javascript:win2.ShowHide('');void(0);">win2</a>
<a href="javascript:document.getElementById('win3').ShowHide('');void(0);">win3</a>
<a href="javascript:document.getElementById('win4').ShowHide('');void(0);">win4</a>
<div id="ssss"></div>
</body>
</html>
效果Q?br />
二、怎样才让在showModalDialog和showModelessDialog的超q接不弹出新H口Q?/strong>
三、怎样才刷新showModalDialog和showModelessDialog里的内容Q?/strong>
<body onkeydown="if (event.keyCode==116){reload.click()}"> filename.htm替换成网늚名字然后它攑ֈ你打开的网里Q按F5可以刷C(jin)Q注意,q个要配?lt;base target="_self">使用Q不然你按下F5?x)弹出新H口的?/p>
四、如何用javascriptx(chng)showModalDialog(或showModelessDialog)打开的窗口?/strong>
五、showModalDialog和showModelessDialog数据传递技巧?/strong>
一般的传递方式:(x) 同时我也可以操作var_id变量 同样q可以对ȝ口的M对象q行操作Q如form对象里的元素?br /> window.dialogArguments.form1.index1.value="q是在设|index1元素的?
六、多个showModelessDialog的相互操作?/strong>
以下代码的主要作用是在一个showModelessDialog里移动别一个showModelessDialog的位|?/p>
L件的部䆾js代码?br /> var s1=showModelessDialog('控制.htm',window,"dialogTop:1px;dialogLeft:1px"Q?/打开控制H口 控制.htm的部份代码?br /> <script> 以上关键部䆾是:(x) q个例子只是现实showModelessDialog与showModelessDialog之间的位|操作功能,通过q个原理Q在showModelessDialog之间怺控制各自的显C页面,传递变量和数据{。这要看各位的发挥了(jin)?/p>
在被打开的网里加上<base target="_self">可以了(jin)。这句话一般是攑֜<html>?lt;body>之间的?/p>
在showModalDialog和showModelessDialog里是不能按F5h的,又不能弹?gu)单。这个只能依靠javascript?jin),以下是相关代码?x)
<a id="reload" href="filename.htm" style="display:none">reload...</a>
<input type="button" value="关闭" onclick="window.close()">
也要配合<base target="_self">Q不然会(x)打开一个新的IEH口Q然后再x(chng)的?/p>
(作者语Q本来想用一问一{Ş式来写的Q但是我想不?gu)个怎么问,所以只好这样了(jin)?
q个东西比较ȝ(ch)Q我改了(jin)好几ơ了(jin)不是没办法说明白(语文水^来差?Q只好用个例子说明了(jin)?br /> 例子Q?br /> 现在需要在一个showModalDialog(或showModelessDialog)里读取或讄一个变量var_name
window.showModalDialog("filename.htm",var_name)
//传递var_name变量
在showModalDialog(或showModelessDialog)d和设|时Q?br /> alert(window.dialogArguments)//dvar_name变量
window.dialogArguments="oyiboy"http://讄var_name变量
q种方式是可以满的Q但是当你想在操作var_name同时再操作第二个变理var_id时呢Q就无法再进行操作了(jin)。这是q种传递方式的局限性?br />
以下是我使用的传递方式:(x)
window.showModalDialog("filename.htm",window)
//不管要操作什么变量,只直传递主H口的window对象
在showModalDialog(或showModelessDialog)d和设|时Q?br /> alert(window.dialogArguments.var_name)//dvar_name变量
window.dialogArguments.var_name="oyiboy"http://讄var_name变量
alert(window.dialogArguments.var_id)//dvar_id变量
window.dialogArguments.var_id="001"http://讄var_id变量
因ؓ(f)光说很费Ԍ我就L(fng)懒,直接用代码来说了(jin)Q如果不明白的话那就直接来信(oyiboy#163.net(使用时请?Ҏ(gu)@))问我吧?/p>
var s2=showModelessDialog('about:blank',window,"dialogTop:200px;dialogLeft:300px"Q //打开被控制窗?/p>
//操作位置数据Q因为窗口的位置数据?xxxpx"方式的,所以需要这L(fng)一个特D操作函数?br /> (tng)function countNumber(A_strNumber,A_strWhatdo)
(tng){
(tng) (tng)A_strNumber=A_strNumber.replace('px','')
(tng) (tng)A_strNumber-=0
(tng) (tng)switch(A_strWhatdo)
(tng) (tng){
(tng) (tng)case "-":A_strNumber-=10;break;
(tng) (tng)case "+":A_strNumber+=10;break;
(tng) (tng)}
(tng) (tng)return A_strNumber + "px"
(tng)}
</script>
<input type="button" onclick="window.dialogArguments.s2.dialogTop=countNumber(window.dialogArguments.s2.dialogTop,'-')" value="上移">
<input type="button" onclick="window.dialogArguments.s2.dialogLeft=countNumber(window.dialogArguments.s2.dialogLeft,'-')" value="左移">
<input type="button" onclick="window.dialogArguments.s2.dialogLeft=countNumber(window.dialogArguments.s2.dialogLeft,'+')" value="右移">
<input type="button" onclick="window.dialogArguments.s2.dialogTop=countNumber(window.dialogArguments.s2.dialogTop,'+')" value="下移">
H口命名方式Qvar s1=showModelessDialog('控制.htm',window,"dialogTop:1px;dialogLeft:1px"Q?br /> 变量讉K方式Qwindow.dialogArguments.s2.dialogTop
(tng) if (str.indexOf("&")>0){
(tng) (tng) (tng) para = parastr.split("&");
(tng) (tng) (tng) for(i=0;i<para.length;i++) {
(tng) (tng) (tng) (tng) (tng) tempstr1 = para[i];
(tng) (tng) (tng) (tng) (tng) pos = tempstr1.indexOf("=");
(tng) (tng) (tng) (tng) (tng) //document.write (tempstr1.substring(0,pos));
(tng) (tng) (tng) (tng) (tng) document.write ("<br>参数"+i+":"+tempstr1.substring(0,pos));
(tng) (tng) (tng) (tng) (tng) document.write ("{于:"+tempstr1.substring(pos+1));
(tng) (tng) (tng) }
(tng) }
</script>
(tng)
<script language="javascript">
(tng)function inhtm() {
(tng) (tng)var n = document.location.search.substring(1);
(tng) (tng)var s = n.substring(n.indexOf("=")+1, n.length);
(tng) (tng)document.write ("ID=:"+s);
(tng)}
</script>
使用户不能更改输入框中的内容Q?/font>
<input type=text value="中国" onfocus=this.blur()>
<input type=text value="中国" (tng)readonly> (tng) (tng) (tng) //只读
<input type=text value="中国" (tng)disabled> (tng) (tng) (tng) (tng) //用