﻿ function AddComent(postID,treaId)
 {
    var treaidTure = "#" + treaId;
    var v = escape($(treaidTure).val());
    if (v == '') {
        alert("内容不能为空");
    }else
    {
 $.ajax({
        type: "POST",
        cache: false,
        url: "./js/addjokePl.aspx?JokeID=" + postID + "&ActoinComent=" + v + "&data=" + Date(),
        beforeSend: function (XMLHttpRequest) {
        },
        success: function (data, textStatus) {
            var u = $('#message');
            u.append(unescape(data)); 
            $(treaidTure).val('')

        },
        complete: function (XMLHttpRequest, textStatus) {

        },
        error: function (XmlHttpRequest, textStatus, errorThrown) {
          //alert(XmlHttpRequest.responseText)
        }
    });
    }
  }
  
  
   function loadname()
 {
    var treaidTure = "#showname";
  
 $.ajax({
        type: "POST",
        cache: false,
        url: "./Ajaxasmx/loadname.aspx?data=" + Date(),
        beforeSend: function (XMLHttpRequest) {
        },
        success: function (data, textStatus) {
        
          if(data!="fail")
          {
            $(treaidTure).html("<a href='./costomercenter/web/CustomerIndex.aspx' style='color:Blue' target='_blank'>"+data + "欢迎您！</a>");
          }

        },
        complete: function (XMLHttpRequest, textStatus) {

        },
        error: function (XmlHttpRequest, textStatus, errorThrown) {
          alert(XmlHttpRequest.responseText)
        }
    });
   
  }
