function trim(inputString)
{
return inputString.replace(/^ +/,"").replace(/ +$/,"");
}
function copycode(obj)
{
var rng = document.body.createTextRange();
rng.moveToElementText(obj);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
}
function runCode(obj)
{
var winname = window.open('', "_blank", '');
winname.document.open('text/html', 'replace');
winname.opener = null // 防止代码对论谈页面修改
winname.document.write(obj.value);
winname.document.close();
}
function saveCode(obj)
{
var winname = window.open('', '_blank', 'top=10000');
winname.document.open('text/html', 'replace');
winname.document.write(obj.value);
winname.document.execCommand('saveas','','code.htm');
winname.close();
}
function showflash(flashURL,flashWIDTH,flashHEIGHT)
{
var flashURL=flashURL;
var flashWIDTH=flashWIDTH;
var flashHEIGHT=flashHEIGHT;
document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+'>');
document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">');
document.writeln ('<PARAM NAME=wmode VALUE=transparent>');
document.writeln ('<PARAM NAME=loop VALUE=true>');
document.writeln ('<PARAM NAME=quality VALUE=high>');
document.writeln ('<EMBED src="'+flashURL+'" loop=true wmode=opaque quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
document.writeln ('</OBJECT>');
}
引用本页地址:
http://www.yongfa365.com/item/3ed9361a32897ca5.html