Seaside on Pharo - 为什么奇怪的 jQuery 集成语法与 Scriptaculous 相比?
Seaside on Pharo - Why the weird jQuery integration syntax compared to Scriptaculous?
示例 1:
html scriptaculous sortable onUpdate: (html scriptaculous... etc).
html jQuery **new** sortable onStop: (html jQuery... etc).
示例 2:
html scriptaculous effect id: helpId; toggleAppear.
(html jQuery id: helpId) slideToggle: 1 seconds.
jQuery 和 Scriptaculous 的集成方式似乎 相似。谁能解释一下两者之间发生了什么设计变化及其对语法的影响(尤其是在第二个示例中)?
JQuery调用模式非常统一,集成到Seaside也是如此:
- 查询:查找所需的 DOM 个元素。
- 动作:对匹配的元素执行动作。
能够同时对多个元素执行操作是非常强大的,也是 JQuery 的优势之一。有关更多详细信息和示例,请查看 these slides.
另一方面,script.aculo.us 是 UI 工具的集合,这些工具不太通用,组织也不太统一。大多数 script.aculo.us 调用需要一个 DOM ID 来标识要处理的元素。这最初可能更简单,但功能也不那么强大。
示例 1:
html scriptaculous sortable onUpdate: (html scriptaculous... etc).
html jQuery **new** sortable onStop: (html jQuery... etc).
示例 2:
html scriptaculous effect id: helpId; toggleAppear.
(html jQuery id: helpId) slideToggle: 1 seconds.
jQuery 和 Scriptaculous 的集成方式似乎 相似。谁能解释一下两者之间发生了什么设计变化及其对语法的影响(尤其是在第二个示例中)?
JQuery调用模式非常统一,集成到Seaside也是如此:
- 查询:查找所需的 DOM 个元素。
- 动作:对匹配的元素执行动作。
能够同时对多个元素执行操作是非常强大的,也是 JQuery 的优势之一。有关更多详细信息和示例,请查看 these slides.
另一方面,script.aculo.us 是 UI 工具的集合,这些工具不太通用,组织也不太统一。大多数 script.aculo.us 调用需要一个 DOM ID 来标识要处理的元素。这最初可能更简单,但功能也不那么强大。