<script>
function objAjax()
{
var objxml=false;
//嘗試建立Microsoft IE瀏覽器支援的物件
try {
objxml = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
objxml = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
aobjxml = false;
}
}
//如果建立不成功,則嘗試建立非Microsoft IE瀏覽器支援的物件
if (!objxml && typeof XMLHttpRequest!='undefined') {
objxml = new XMLHttpRequest();
}
return objxml;
}
function openurl(url)
{
var objxml=objAjax();
// var objxml=new ActiveXObject("Microsoft.XMLHttp") //建立
objxml.open("GET",url,false); //開啟
objxml.send(); //傳送
retInfo=objxml.responseText; 接收 返回文字字串
if(objxml.readyState == 1) //初始化
{
document.getElementById("aboutproDiv").innerHTML ="正在載入資料...";
}
if(objxml.readyState == 4) //資料接收完畢
{
document.getElementById("aboutproDiv").style.display="none";//隱藏
return retInfo;
}
else
{
return "-2";
}
}
function checkapp(form){
infoBoard=document.getElementById("aboutpro_i");
myurl="getdis.aspx?pid="+<!--@proId@-->+"&rnd="+Math.random();
var retCode = openurl(myurl);
switch(retCode){
case "-2": infoBoard.innerHTML='該商品暫無評論';break;
default:{
infoBoard.innerHTML=retCode;
}break;
}
return;
}
</script>
function objAjax()
{
var objxml=false;
//嘗試建立Microsoft IE瀏覽器支援的物件
try {
objxml = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
objxml = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
aobjxml = false;
}
}
//如果建立不成功,則嘗試建立非Microsoft IE瀏覽器支援的物件
if (!objxml && typeof XMLHttpRequest!='undefined') {
objxml = new XMLHttpRequest();
}
return objxml;
}
function openurl(url)
{
var objxml=objAjax();
// var objxml=new ActiveXObject("Microsoft.XMLHttp") //建立
objxml.open("GET",url,false); //開啟
objxml.send(); //傳送
retInfo=objxml.responseText; 接收 返回文字字串
if(objxml.readyState == 1) //初始化
{
document.getElementById("aboutproDiv").innerHTML ="正在載入資料...";
}
if(objxml.readyState == 4) //資料接收完畢
{
document.getElementById("aboutproDiv").style.display="none";//隱藏
return retInfo;
}
else
{
return "-2";
}
}
function checkapp(form){
infoBoard=document.getElementById("aboutpro_i");
myurl="getdis.aspx?pid="+<!--@proId@-->+"&rnd="+Math.random();
var retCode = openurl(myurl);
switch(retCode){
case "-2": infoBoard.innerHTML='該商品暫無評論';break;
default:{
infoBoard.innerHTML=retCode;
}break;
}
return;
}
</script>
<body onload="checkapp()">
<div id="aboutpro_i">
<DIV id=aboutproDiv >正在載入中...</DIV>
<!--@item@-->
</div>
//getdis.aspx cs程式碼
protected void Page_Load(object sender, EventArgs e)
{
if (Request["pid"] != null)
{
string strReturn = "該商品暫無評論...";
string strSql = "select * from cuspro where pid="+Request["pid"].ToString()+" order by id desc";
chat c = new chat();
DataTable dt = c.SqlselectPro(strSql,2);
if (dt.Rows.Count > 0)
{
strReturn = "";
foreach(DataRow dr in dt.Rows)
{
string re=dr["reply"].ToString();
if (re != "")
{
strReturn += "<div class='protitle'>評論者:" + dr["mname"].ToString() + " " + dr["ctime"] + " 對 " + dr["pname"].ToString() + " 評論!</div>"; ;
strReturn += "<div class='aboutproitem'>" + dr["items"].ToString() + "</div>";
strReturn += "<div class='aboutproitem1'>" + dr["reply"].ToString() + "</div>";
}
else
{
strReturn += "<div class='protitle'>評論者:" + dr["mname"].ToString() + " " + dr["ctime"] + " 對 " + dr["pname"].ToString() + " 評論!</div>"; ;
strReturn += "<div class='aboutproitem'>" + dr["items"].ToString() + "</div>";
}
}
}
Response.Write(strReturn);
}
}