【问题标题】:What is wrong in this openlaszlo code?这个 openlaszlo 代码有什么问题?
【发布时间】:2012-08-07 13:07:25
【问题描述】:

我想知道这段代码有什么问题

<canvas> 
    <view y="50" width="100%" height="300" bgcolor="blue" onmousedown="res.apply()" onmouseup="res.remove()">
        <resizestate name="res"/>
        <dragstate name="drg"/>
        <text width="100%" bgcolor="gray" onmousedown="parent.drg.apply()" onmouseup="parent.drg.remove()">Drag here</text>
        <html id="ht" src="text.html" x="15" y="15" width="${parent.width - 30}" height="${parent.height - 30}"/>
    </view>
</canvas>

代码已编译,但我无法在 swf 版本中看到 html,但我能够在 dhtml 版本中看到 html。我也试过指定网址还是没有结果

【问题讨论】:

  • 您的代码没有问题。看起来像一个 OpenLaszlo 错误。

标签: dhtml openlaszlo


【解决方案1】:

自 2006 年以来,我一直在 OpenLaszlo 中进行开发,我个人尝试在 SWF 运行时下使用 OpenLaszlo 标记的经验是,我加载到其中的一半页面可以正常工作,而其中一半不能.我遇到过即使来自 Google 的简单网页也无法运行的情况,这是一个非常不稳定的类,我不建议使用它。

【讨论】:

    【解决方案2】:

    对于某些基于 Webkit 的浏览器(Chrome 和 Safari),在 OpenLaszlo 5.0(主干)的 SWF10 运行时中, 标记功能似乎被破坏了,但也存在其他问题。我已经修改了一些代码来做一些测试:

    <canvas>
      <button text="OpenLaszlo" onclick="ht.setAttribute('src', 'http://www.openlaszlo.org')" />
      <button y="40" text="test.html" onclick="ht.setAttribute('src', 'test.html')" />
      <view y="200" width="100%" height="300" bgcolor="blue" onmousedown="res.apply()" onmouseup="res.remove()">
        <resizestate name="res"/>
        <dragstate name="drg"/>
        <text width="100%" bgcolor="gray" onmousedown="parent.drg.apply()" onmouseup="parent.drg.remove()">Drag here</text>
        <html id="ht" src="http://www.openlaszlo.org" x="15" y="15" width="${parent.width - 30}" height="${parent.height - 30}"/>
      </view>
    </canvas>
    

    以下是我使用此代码在 SWF10 运行时看到的结果:

    • InternetExplorer 9、Chromium 18 和 Opera 12:两个页面(本地 test.html 和 OpenLaszlo)都显示在 iFrame 中。
    • Firefox:显示远程网站 OpenLaszlo.org,但未显示本地 test.html。
    • Safari 5.1 和 Chrome 21:两个页面均未显示在 iFrame 中

    我会提交一个OpenLaszlo Jira 错误,并向laszlo-dev 开发人员邮件列表发送一条消息,以参考此讨论。

    【讨论】:

    • 谢谢 raju。我也可以在 OL 4.9 中重现这个。我将尝试以编程方式创建 iframe 并查看此问题。
    猜你喜欢
    • 2014-08-29
    • 2013-06-05
    • 2014-06-04
    • 2011-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多