代码主要就是下面几个方法..,我比对了firefox下不支持的23个方法http://www.52css.com/article.asp?id=987
还是没找出来,麻烦各位帮我看看
function findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function jtgo(cc){
var str='';
for(var i=0;i<cc.length;i++){
if(charft().indexOf(cc.charAt(i))!=-1)
str+=charjt().charAt(charft().indexOf(cc.charAt(i)));
else if(charhx().indexOf(cc.charAt(i))!=-1)
str+=charjt().charAt(charhx().indexOf(cc.charAt(i)));
else
str+=cc.charAt(i); }
return str; }
function ftgo(cc){
var str='';
for(var i=0;i<cc.length;i++){
if(charjt().indexOf(cc.charAt(i))!=-1)
str+=charft().charAt(charjt().indexOf(cc.charAt(i)));
else if(charhx().indexOf(cc.charAt(i))!=-1)
str+=charft().charAt(charhx().indexOf(cc.charAt(i)));
else
str+=cc.charAt(i); }
return str; } function qqgo(cc){
var str='';
for(var i=0;i<cc.length;i++){
if(charjt().indexOf(cc.charAt(i))!=-1)
str+=charhx().charAt(charjt().indexOf(cc.charAt(i)));
else if(charft().indexOf(cc.charAt(i))!=-1)
str+=charhx().charAt(charft().indexOf(cc.charAt(i)));
else
str+=cc.charAt(i); }
return str; }function convert(){
if(h1.value==0)
txt.value=jtgo(txt.value);
else if(h1.value==2)
txt.value=qqgo(txt.value);
else
txt.value=ftgo(txt.value);
}
还是没找出来,麻烦各位帮我看看
function findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function jtgo(cc){
var str='';
for(var i=0;i<cc.length;i++){
if(charft().indexOf(cc.charAt(i))!=-1)
str+=charjt().charAt(charft().indexOf(cc.charAt(i)));
else if(charhx().indexOf(cc.charAt(i))!=-1)
str+=charjt().charAt(charhx().indexOf(cc.charAt(i)));
else
str+=cc.charAt(i); }
return str; }
function ftgo(cc){
var str='';
for(var i=0;i<cc.length;i++){
if(charjt().indexOf(cc.charAt(i))!=-1)
str+=charft().charAt(charjt().indexOf(cc.charAt(i)));
else if(charhx().indexOf(cc.charAt(i))!=-1)
str+=charft().charAt(charhx().indexOf(cc.charAt(i)));
else
str+=cc.charAt(i); }
return str; } function qqgo(cc){
var str='';
for(var i=0;i<cc.length;i++){
if(charjt().indexOf(cc.charAt(i))!=-1)
str+=charhx().charAt(charjt().indexOf(cc.charAt(i)));
else if(charft().indexOf(cc.charAt(i))!=-1)
str+=charhx().charAt(charft().indexOf(cc.charAt(i)));
else
str+=cc.charAt(i); }
return str; }function convert(){
if(h1.value==0)
txt.value=jtgo(txt.value);
else if(h1.value==2)
txt.value=qqgo(txt.value);
else
txt.value=ftgo(txt.value);
}
这里是html上的代码
<TEXTAREA class="Textbox" id="txt" rows="8" style="width:750px; color:#333;" >输入你要转换的内容</TEXTAREA>
<INPUT onclick="h1.value=2;convert()" type=button value="" class="submit">
<INPUT onClick="h1.value=0;convert()" type=button value="" class="submit">
<INPUT onClick="h1.value=1;convert()" type=button value="" class="submit">
<INPUT onClick="copy('txt')" type=button value="复制" name=Button class="submit">
<INPUT onClick="cut('txt')" type=button value="剪切" name=Button class="submit">
<INPUT onClick="document.getElementById[txt].value=''" type=button value="清空" name=Button class="submit">
document.getElementById("h1").value="";document.getElementById[txt].value=''改成
document.getElementById('txt').value=''
没看到你那里有h1....代码贴全....
你直接就把整个页面的代码放上来我好帮你调试...你现在给的代码IE下都不能调试...