主頁(yè) > 知識(shí)庫(kù) > pjblog發(fā)表評(píng)論用的ajaxJS.js

pjblog發(fā)表評(píng)論用的ajaxJS.js

熱門標(biāo)簽:電銷機(jī)器人違法了嗎 澳大利亞城市地圖標(biāo)注 海南銀行智能外呼系統(tǒng)商家 上海浦東騰訊地圖標(biāo)注位置 許昌智能電銷機(jī)器人公司 遼寧銀行智能外呼系統(tǒng) 姜堰電銷機(jī)器人 遼寧正規(guī)電銷機(jī)器人 辰溪地圖標(biāo)注

document.write('DIV id="loadingg"  style="HEIGHT:65px; WIDTH: 200px;POSITION: absolute; Z-INDEX:1000;border:3px;solid;text-align:center;sans-serif;color:#000000;background-color:#FFFFFF;opacity:.7;-moz-opacity:.7;filter: Alpha(Opacity=75, FinishOpacity=50, Style=1, StartX=0, StartY=1, FinishX=200, FinishY=100); display:none;">br/>font color="#708090">b>數(shù)據(jù)正在讀取中,請(qǐng)等候.../b>/font>br/>img src="images/loading.gif"/>/DIV>')
function showloading() 
{
var obj=document.getElementById("loadingg")
if (obj.style.display!="")
{
obj.style.left=((document.documentElement.clientWidth-parseFloat (obj.style.width))/2)+document.documentElement.scrollLeft+"px";
obj.style.top=((document.documentElement.clientHeight-parseFloat (obj.style.height))/2)+document.documentElement.scrollTop+"px";
obj.style.display="";
}else{obj.style.display="none";}
}


function $(id)
{
    return document.getElementById(id);    
}
function echo(obj,html)
{
    $(obj).innerHTML=html;
}
function fopen(obj)
{
    $(obj).style.display="";
}
function fclose(obj)
{
    $(obj).style.display="none";
}
function createxmlhttp()
{
    var xmlhttp=false;
    try    {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
     } 
    catch (e) {
          try {
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } 
        catch (e) {
               xmlhttp = false;
         }
     }
    if (!xmlhttp  typeof XMLHttpRequest!='undefined') {
          xmlhttp = new XMLHttpRequest();
                if (xmlhttp.overrideMimeType) {//設(shè)置MiME類別
            xmlhttp.overrideMimeType('text/xml');
        }
    }    

    return xmlhttp;    
}

function getdata(url,obj1,obj2)
{
        var xmlhttp=createxmlhttp();
        if(!xmlhttp)
        {
            alert("你的瀏覽器不支持XMLHTTP??!");
            return;
        }
        showloading() 
        xmlhttp.onreadystatechange=requestdata;
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        function requestdata()
        {

                fopen(obj1);
                //echo(obj1,"正在加載數(shù)據(jù),請(qǐng)稍等......");
                //alert(xmlhttp.readyState)
                if(xmlhttp.readyState==4)
                {
                    if(xmlhttp.status==200)
                    {
                        if(obj1!=obj2){fclose(obj1);};
                        echo(obj2,xmlhttp.responseText);
                        showloading() 
                    }
                }

        }
}
function postdata(url,obj,data)
{       var rnd=Math.random()
        var xmlhttp=createxmlhttp();
        if(!xmlhttp)
        {
            alert("你的瀏覽器不支持XMLHTTP??!");
            return;
        }
        showloading() 
        xmlhttp.open("POST", url, true);
        xmlhttp.onreadystatechange=requestdata;
        xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        xmlhttp.send(data);
        function requestdata()
        {
            fopen(obj);
            echo(obj,"正在提交數(shù)據(jù),請(qǐng)稍等......");
            if(xmlhttp.readyState==4)
            {
                if(xmlhttp.status==200)
                {
                    echo(obj,xmlhttp.responseText);
                    reget(rnd);
                    setTimeout("echo('showresult','')",2000);
                    echo('Message','')
                    showloading() 
                }
            }
        }
}
function lTrim(str)
{
  if (str.charAt(0) == " ")
  {
    //如果字串左邊第一個(gè)字符為空格
    str = str.slice(1);//將空格從字串中去掉
    //這一句也可改成 str = str.substring(1, str.length);
    str = lTrim(str);    //遞歸調(diào)用
  }
  return str;
}

//去掉字串右邊的空格
function rTrim(str)
{
  var iLength;

  iLength = str.length;
  if (str.charAt(iLength - 1) == " ")
  {
    //如果字串右邊第一個(gè)字符為空格
    str = str.slice(0, iLength - 1);//將空格從字串中去掉
    //這一句也可改成 str = str.substring(0, iLength - 1);
    str = rTrim(str);    //遞歸調(diào)用
  }
  return str;
}

//去掉字串兩邊的空格
function trim(str)
{
  return lTrim(rTrim(str));
}

function f(obj)
{
    return trim(eval("document.ajax_post."+obj+".value"));
    //return trim($(obj).value);
}

function SaveReply()
{
    if(f("username")=="")
    {
        alert("請(qǐng)?zhí)顚懹脩裘?);
        return false;
    }
    if(f("Message")=="")
    {
        alert("內(nèi)容不可為空");
        return false;
    }
    var validate,password,log_DisKey=0,log_DisURL=0,log_DisSM=0
    validate=""
    password=""
    if(document.ajax_post.log_DisKey.checked){
        log_DisKey=f("log_DisKey")
        }
    if(document.ajax_post.log_DisURL.checked){
        log_DisURL=f("log_DisURL")
        }
    if(document.ajax_post.log_DisSM.checked){
        log_DisSM=f("log_DisSM")
        }
    if((typeof eval(document.ajax_post.validate))!="undefined"){
        if(f("validate")=="")
        {
            alert("請(qǐng)?zhí)顚戲?yàn)證碼");
            return false;
        }else{
            validate=f("validate");
        }
    }    
    if((typeof eval(document.ajax_post.password))!="undefined"){
        password=f("password");
    }
    data="username="+escape(f("username"))+"password="+escape(password)+"validate="+escape(validate)+"log_DisSM="+escape(log_DisSM)+"log_DisURL="+escape(log_DisURL)+"log_DisKey="+escape(log_DisKey)+"Message="+escape(f("Message"))+"logID="+escape(f("logID"))+"action="+escape(f("action"));
    //alert(data);
    postdata("wbc_blogcomm.asp","showresult",data);
    return true;
}
您可能感興趣的文章:
  • JavaScript直播評(píng)論發(fā)彈幕切圖功能點(diǎn)集合效果代碼
  • 使用AngularJS和PHP的Laravel實(shí)現(xiàn)單頁(yè)評(píng)論的方法
  • javascript無(wú)刷新評(píng)論實(shí)現(xiàn)方法
  • Json實(shí)現(xiàn)異步請(qǐng)求提交評(píng)論無(wú)需跳轉(zhuǎn)其他頁(yè)面
  • js寫的評(píng)論分頁(yè)(還不錯(cuò))
  • js實(shí)現(xiàn)簡(jiǎn)單的星級(jí)選擇器提交效果適用于評(píng)論等
  • JS類定義原型方法的兩種實(shí)現(xiàn)的區(qū)別評(píng)論很多
  • javascript發(fā)表評(píng)論或者留言時(shí)的展開效果
  • 一個(gè)jsp+AJAX評(píng)論系統(tǒng)
  • JS擴(kuò)展Z-Blog圖片驗(yàn)證碼的單擊自動(dòng)刷新與評(píng)論內(nèi)容自動(dòng)保存
  • 原生js實(shí)現(xiàn)回復(fù)評(píng)論功能

標(biāo)簽:威海 撫州 西藏 伊春 深圳 銅川 晉城 崇左

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《pjblog發(fā)表評(píng)論用的ajaxJS.js》,本文關(guān)鍵詞  pjblog,發(fā)表,評(píng)論,用的,ajaxJS.js,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《pjblog發(fā)表評(píng)論用的ajaxJS.js》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于pjblog發(fā)表評(píng)論用的ajaxJS.js的相關(guān)信息資訊供網(wǎng)民參考!
  • 企业400电话

    智能AI客服机器人
    15000

    在线订购

    合计11份范本:公司章程+合伙协议+出资协议+合作协议+股权转让协议+增资扩股协议+股权激励+股东会决议+董事会决议

    推薦文章