一个不错的可以检测多中浏览器的函数和其它功能第1/2页

2019-06-03 00:36:02丽君

if (is_moz) {
    var tmp_c=document.getElementById('v_content');
    if (tmp_c) tmp_c.value='';
}

//Show/Hide a DIV
function showhidediv(id){
  try{
    var panel=document.getElementById(id);
    if(panel){
      if(panel.style.display=='none'){
        panel.style.display='block';
      }else{
        panel.style.display='none';
      }
    }
  }catch(e){}
}

function addhtml (id, htmlcode, uniqueid) {
    var panel=document.getElementById(id);
    var hiddenpannel=document.getElementById(uniqueid);
    if(panel){
        hiddenpannel.value='';
        hiddenpannel.value=panel.innerHTML;
        panel.innerHTML=hiddenpannel.value+htmlcode;
        hiddenpannel.value+=htmlcode;
    }
}

function showadminreply (divid) {
    switchcomandmes='reply';
    var cleanid=divid.replace('com_', '');
    var inputcontent="<form action='"+absbaseurl+"admin.php?go=reply_addadminreply_"+cleanid+"' method='post' id='formadminreply"+cleanid+"'>";
    inputcontent+=jslang[0]+"<br/><textarea cols='66' rows='3' name='adminreplycontent' id='adminreplycontent"+cleanid+"'></textarea><br/>";
    inputcontent+="<input type='button' onclick="ajax_adminreply('"+cleanid+"'); return false;" value='"+jslang[1]+"' class='button'/> <input type='reset' value='"+jslang[2]+"' class='button'/> <input type='button' value='"+jslang[3]+"' onclick="hideadminreply('"+divid+"');" class='button'/></form>";
    document.getElementById(divid).innerHTML=inputcontent;
    document.getElementById(divid).style.display='block';
}

function showadminreplyformessage (divid) {
    switchcomandmes='message';
    var cleanid=divid.replace('com_', '');
    var inputcontent="<form action='"+absbaseurl+"admin.php?go=message_addadminreply_"+cleanid+"' method='post' id='formadminreply"+cleanid+"'>";
    inputcontent+=jslang[0]+"<br/><textarea cols='66' rows='3' name='adminreplycontent' id='adminreplycontent"+cleanid+"'></textarea><br/>";