的 innerHTML 被打开时触发事件变化。在 YUI 或其他方式中

发布于 2024-08-31 05:02:14 字数 1436 浏览 1 评论 0原文

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

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

发布评论

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

评论(3

放手` 2024-09-07 05:02:14

使用设置器:

myDiv.__defineSetter__("innerHTML",
  function(newHTML) {
    ...
  }
);

https://developer.mozilla.org/en/Core_JavaScript_1。 5_Guide/Working_with_Objects#Defining_Getters_and_Setters

Use a setter:

myDiv.__defineSetter__("innerHTML",
  function(newHTML) {
    ...
  }
);

https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Working_with_Objects#Defining_Getters_and_Setters

紫瑟鸿黎 2024-09-07 05:02:14

我认为 Fabian 是对的,您需要使用计时器并比较该值。

话虽这么说,在 YUI3 中执行此操作的正确方法是定义一个 合成 DOM事件使用稍后

I think Fabian's right in that you'll need to user a timer and compare the value.

That being said, the right way to do this in YUI3 would be to define a synthetic DOM event using later.

迷雾森÷林ヴ 2024-09-07 05:02:14

div 没有开箱即用的 onchange 事件。如果您想要这个,您将自己编写它(使用计时器并存储当前值等)。

然而,当您更改该 div 的 innerValue 来处理 ... w/e 时,我会尝试退一步并调用一个方法。

There is no out of the box onchange event for divs. If you want this you are going to have write this yourself (with a timer and storing whats the current value etc).

I would however try to take it a step back and call a method when you change the innerValue of that div to take care of ... w/e.

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