Robin's Blog

记录 积累 学习 成长

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
<title>意见反馈</title> 
<style type="text/css"> 
/*author:sunny*/
*
{padding:0;margin:0}
body
{font-family: "宋体", Arial, Helvetica, sans-serif; font-size:12px; background:#fff; color:#404040;margin-top:0px;}
img
{border:0}
a
{ color:#1a66b3; text-decoration:none}
a:hover
{ color:#1a66b3; text-decoration:underline}
 
.comm_research
{width:450px; padding-bottom:4px; background:url(images/dang_r_bottom_gray.gif) repeat-x bottom; margin:auto; margin-top:0px}
.comm_research_top
{ width:450px; height:29px; background:url(images/dang_r_top_c.gif) repeat-x}
.comm_research_top .bg_l
{ width:6px; height:29px; float:left; background:url(images/dang_r_top_l.gif) no-repeat}
.comm_research_top h2
{width:120px; padding-left:33px; background:url(images/right_h2_bg.gif) no-repeat 10px 7px; font-weight:normal; color:#853200; height:29px; line-height:29px; font-size:12px;float:left}
.comm_research_top .bg_r
{ width:4px; height:29px; float:right; background:url(images/dang_r_top_r.gif) no-repeat}
.comm_research_center
{padding:5px 5px 5px 16px;border-left:solid 1px #a1a1a1; border-right:solid 1px #a1a1a1;background-color:#f9f9f9;}
.comm_research_center p
{ line-height:18px; color:#878787; margin:0; padding:7px 5px 5px 0}
.comm_research_center textarea
{ width:410px; height:80px; border:solid 1px #d3d3d3; font-size:12px; padding:2px 1px}
.comm_research_center input
{ width:68px; height:22px; margin:10px 0 5px 170px}
.text_center
{ text-align:center}
</style>   
<script type="text/javascript" > 
 
  
//research.js
 
function $(id)
{
    
return document.getElementById(id);
};
 
function getCookie(name) {
  
var search;
  search 
= name + "="
  offset 
= document.cookie.indexOf(search) 
  
if (offset != -1) {
    offset 
+= search.length ;
    end 
= document.cookie.indexOf(";", offset) ;
    
if (end == -1)
      end 
= document.cookie.length;
    
return unescape(document.cookie.substring(offset, end));
  }
  
else
    
return "";
}
 
 
function g(id){
     
return $(id);
}
 
function replaceHTML(data){
    
return data.replace(/\</g,"");
}
 
function checkResearchContent(){
    
if(g("research_content")!=null){
        
if(g("research_content").value==""return false;
        
var contlen = g("research_content").value.length;
        
if(contlen>500){
            g(
"research_result").innerHTML = "限制为500字!目前字数为"+contlen+"";
            
return false;
        }
        
return true;
    }
}
 
var http=null;
var POST_URL="http://doc.dangdang.com/Research/PostResearch.ashx";
function postResearch(agentHandler){
    
if(checkResearchContent()==falsereturn;
 
    
var type = g("research_type").value;
    
var content = replaceHTML(g("research_content").value);
    
var custId = getCookie("custid");
    
var postUrl = window.location.href;    
    g(
"research_result").innerHTML = "提交中";
 
    
if(window.XMLHttpRequest) // Mozilla
    { 
        http
=new XMLHttpRequest();
        
if(http.overrideMimeType)
            http.overrideMimeType(
"text/html;");
    }
    
else if(window.ActiveXObject) // IE
    {
        
try
        {
            http
=new ActiveXObject("Msxml2.XMLHTTP");
        }
        
catch(e)
        {
            
try
            {
                http
=new ActiveXObject("Microsoft.XMLHTTP");
            }
catch(e)
            {
            }
        }
    }
 
    
if(http==nullreturn;
    
    http.onreadystatechange 
= postResearchProcessResponse;
    http.open(
"POST", agentHandler, true);
    
//HttpRequest.setRequestHeader("if-Modified-Since","0");
    http.setRequestHeader("Content-Type""application/x-www-form-urlencoded;charset=utf-8"); 
    
try
    {
         http.send(
"request_url="+POST_URL+"&type="+type+"&content="+content+"&custId="+custId+"&postUrl="+postUrl);
    } 
catch (e)
    {
    }
}
 
function postResearchProcessResponse(){
    
if(http!=null){
        
if(http.readyState == 4){
            
if(http.status != 200)
                
return;
 
            
var result = http.responseText;
            
if(result == "false"){
                g(
"research_result").innerHTML ="提交有误!";
            }
            
else{
                g(
"research_content").value="";
                g(
"research_result").innerHTML = "感谢您的反馈!";
            }
        }
    }
}
 
</script> 
</head> 
<body> 
    
<div class="comm_research" id="ucresearchWindow"  style="position:absolute;z-index:10000;"> 
        
<div class="comm_research_top"> 
        
<div class="bg_l"></div><h2>小调查</h2><div class="bg_r"></div>    
        
</div> 
      
<div class="comm_research_center"> 
            
<p>您现在看到的是新版当当首页,对于这个页面您有任何想法,都欢迎反馈给我们。我们会认真考虑您的意见和建议,把当当首页做得更好,谢谢!</p> 
            
<textarea name="" cols="" rows="" id="research_content"></textarea> 
            
<input type="button" name="Submit" value="  提 交" onclick="postResearch('PostResearch.ashx')" /> 
            
<class="text_center" id="research_result"></p> 
  
</div><input type="hidden" id="research_type" value="50" />    
</div> 
</body> 
</html
posted on 2009-04-22 10:37  Robin99  阅读(133)  评论(0编辑  收藏  举报