2010-05-06 118 views
-1

我運行使用JavaScript代碼獲取瀏覽器信息,它在Microsoft Windows XP上運行良好,但它不能在Microsoft Windows Server 2003上運行。我的代碼正在出現。 plz幫助。Zeroclipboard問題

<html> 
    <head> 
    <script type="text/javascript" src="zeroclipboard/ZeroClipboard.js"></script> 

     <script type="text/javascript"> 
      window.onload = function F() { 
       var today = new Date(); 
       var the_date = new Date("December 31, 2012"); 
       var the_cookie_date = the_date.toGMTString(); 
       var the_cookie = screen.width +"x"+ screen.height; 
       var the_cookie = "Screen Resolution:"+the_cookie + ";\nExpires:" + the_cookie_date+";\n Browser CodeName:"+navigator.appCodeName+";\n Browser Name: " + navigator.appName+";\n Browser Version: " + navigator.appVersion+";\n Browser Version: " + navigator.appVersion+"; \n Cookies Enabled: " + navigator.cookieEnabled +";\n Platform: " + navigator.platform+";\n User-agent header: " + navigator.userAgent; 
       /

       document.getElementById('box-content').value=the_cookie; 
      } 





     </script> 
    </head> 
    <body> 


<textarea name="box-content" id="box-content" rows="10" cols="70"> 
</textarea> 
<br /><br /> 
<p><input type="button" id="copy" name="copy" value="Copy to Clipboard" /></p> 

    </body> 
</html> 
<script type="text/javascript"> 
     //set path 

     ZeroClipboard.setMoviePath('http://192.168.101.135:471/browserinfo/zeroclipboard/ZeroClipboard.swf'); 
     //create client 
     var clip = new ZeroClipboard.Client(); 
     //event 
     clip.addEventListener('mousedown',function() { 
      clip.setText(document.getElementById('box-content').value); 
     }); 
     clip.addEventListener('complete',function(client,text) { 
      alert('text is copied'); 
     }); 
     //glue it to the button 
     clip.glue('copy'); 
    </script> 
+1

會發生什麼或不會發生什麼?什麼錯誤信息出現? – 2010-05-06 14:06:21

+5

我知道它是有效的,但是隻要我在''容器關閉後看到'

0

或者您沒有Flash(如前所述),或者您無法訪問服務器計算機上的192.168.101.135 ....