零剪贴板问题

发布于 2024-08-31 17:24:18 字数 2014 浏览 8 评论 0原文

我运行使用 JavaScript 代码来获取浏览器信息,它在 Microsoft Windows XP 上运行良好,但在 Microsoft Windows Server 2003 上运行不正常。我的代码如下。请帮忙。

<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>

i run use a javascript code for getting browser information it run fine on microsoft windows xp but it not working on microsoft windows server 2003. my code is folowing. plz help.

<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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

走走停停 2024-09-07 17:24:18

您可能没有在 Windows Server 机器上安装 Flash 播放器,这是运行 ZeroClipboard 所必需的。

You might not have Flash player installed on the Windows Server box, which is required to run ZeroClipboard.

谜兔 2024-09-07 17:24:18

或者您没有 Flash(如前所述)或者您无法访问服务器计算机上的 192.168.101.135...

Or you don't have Flash (as said before) or you don't have access to 192.168.101.135 on servers machine....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文