function Bubble(t,o,s)
{
this.t = t;
this.o = o;
this.b = false;
this.s = typeof s != 'undefined' ? s : 0;
}
Bubble.prototype.display = function (s)
{
if ( this.b )
{
this.b.innerHTML = s;
this.b.style.marginTop = -
(this.b.offsetHeight+this.o+4)+'px';
return true;
}
this.b = document.createElement ( 'span' );
if(!this.b)return false;
obj=this;
this.b.onclick=function(){obj.hide();}
var styles =
{
'backgroundColor' : '#FBFFDF',
'border' : '1px solid #505050',
'padding' : '5px',
'position' : 'absolute',
'lineHeight' : '1.4em',
'MozBorderRadius' : '4px'
};
if ( this.s > 0 ) styles['width'] = this.s + 'px';
setStyles ( this.b, styles );
this.b.innerHTML = s;
this.t.parentNode.insertBefore(this.b,this.t);
this.b.style.marginTop = -(this.b.clientHeight+this.o+4)+'px';
}
Bubble.prototype.hide = function()
{
if(!this.b)return true;
this.b.style.display='none';
//deleteNode(this.b);
this.b=false;
}
+++++++++++++++++++++++++++++++++++++++++++
function checkName ( )
{
if ( !newpm_to ) return false;
var username = newpm_to.value;
var checkURL = 'usercp.php?action=checkname&username=' + escape
( username );
var check = function ( result )
{
if ( result == 'OK' )
{
bubble.display ( ' <img
src="templates/defaultcn/images/check.gif" class="img1" alt="" /> 找到
用户.' );
timer.start('bubble.hide()',1500);
}
else
{
bubble.display(' <img
src="templates/default2/images/ex.gif" class="img1" alt="" /> ' +
result);
}
}
xmlhttpGet(checkURL,check);
}
result在PHP网页调用中为中文字串,但网页显示时为????,不能正常显示汉字,问题出在哪里,请高手指点
[此贴子已经被作者于2006-7-31 22:52:11编辑过]