【问题标题】:Java applet created in Processing doesn't run in Safari在 Processing 中创建的 Java 小程序不能在 Safari 中运行
【发布时间】:2011-05-12 07:30:40
【问题描述】:

我有一个用Processing 制作的小程序,它不能在Safari 中运行。我一直在网上寻求帮助,并在对象标签中更改为使用“代码”而不是“classid”,因为我读到Safari可能无法打开任何在对象定义中包含classid的小程序。

结果似乎在 Firefox、Chrome 和 Internet Explorer 中运行,但在 Safari 中仍然没有。现在在 Safari 中,我得到了小程序窗口的轮廓和处理标志的快速闪烁,这是我以前没有得到的——但就是这样。

我也试过用“applet”标签代替“object”标签,但还是不行。

下面是我的 HTML 正文。

<body>
    <div id="content">
        <div id="Working_SVGPuzzler8_container">

            <!-- This version plays nicer with older browsers,
                 but requires JavaScript to be enabled.
                 http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html
            -->
            <script type="text/javascript"
                src="http://www.java.com/js/deployJava.js"></script>

            <script type="text/javascript">
                /* <![CDATA[ */

                var attributes = {
                      code: 'Working_SVGPuzzler8.class',
                      archive: 'Working_SVGPuzzler8.jar,SoundCipher.jar,core.jar',
                      width: 800,
                      height: 600,
                      image: 'loading.gif'
                    };
                    var parameters = { };
                    var version = '1.5';
                    deployJava.runApplet(attributes, parameters, version);

                    /* ]]> */
            </script>

            <noscript>
                <div>
                    <!--[if !IE]> -->
                    <object code="Working_SVGPuzzler8.class"
                                type="application/x-java-applet"
                                archive="Working_SVGPuzzler8.jar,SoundCipher.jar,core.jar"
                                width="800" height="600"
                                standby="Loading Processing software..." >

                        <param name="archive" value="Working_SVGPuzzler8.jar,SoundCipher.jar,core.jar" />

                        <param name="mayscript" value="true" />
                        <param name="scriptable" value="true" />

                        <param name="image" value="loading.gif" />
                        <param name="boxmessage" value="Loading Processing software..." />
                        <param name="boxbgcolor" value="#FFFFFF" />

                        <param name="test_string" value="outer" />
                    <!--<![endif]-->

                    <!-- For more instructions on deployment,
                         or to update the CAB file listed here, see:
                         http://java.sun.com/javase/6/webnotes/family-clsid.html
                         http://java.sun.com/javase/6/webnotes/install/jre/autodownload.html
                    -->
                    <object
                        code="Working_SVGPuzzler8.class"
                        codebase="http://java.sun.com/update/1.6.0/jinstall-6u20-windows-i586.cab"
                        width="800" height="600"
                        standby="Loading Processing software..."  >

                        <param name="code" value="Working_SVGPuzzler8" />
                        <param name="archive" value="Working_SVGPuzzler8.jar,SoundCipher.jar,core.jar" />

                        <param name="mayscript" value="true" />
                        <param name="scriptable" value="true" />

                        <param name="image" value="loading.gif" />
                        <param name="boxmessage" value="Loading Processing software..." />
                        <param name="boxbgcolor" value="#FFFFFF" />

                        <param name="test_string" value="inner" />
                        <p>
                            <strong>
                                This browser does not have a Java Plug-in.
                                <br />
                                <a href="http://www.java.com/getjava" title="Download Java Plug-in">
                                  Get the latest Java Plug-in here.
                                </a>
                            </strong>
                        </p>
                    </object>
                    <!--[if !IE]> -->
                    </object>
                    <!--<![endif]-->
                </div>
            </noscript>

        </div>

        <p>
        </p>
        <p>
        </p>
        <p>
            Built with <a href="http://processing.org" title="Processing.org">Processing</a>
        </p>
    </div>
</body>

【问题讨论】:

    标签: java applet processing


    【解决方案1】:

    愿意与我们分享处理代码吗?除此之外,这是一个常见的问题。如果您可以使用原始 Java 编写处理应用程序,那么您在 Safari 中就可以了。

    【讨论】:

      【解决方案2】:

      当您从处理 IDE 导出草图时,它是否也拒绝加载?

      这会生成小程序以及加载草图小程序的 index.html。如果这在原版 Safari 中不起作用(所以没有夜间 WebKits 等),那么处理中可能存在错误,值得在 http://code.google.com/p/processing/issues 的处理问题跟踪器上报告它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-08-24
        • 1970-01-01
        • 2015-03-24
        • 1970-01-01
        • 2010-10-27
        相关资源
        最近更新 更多