gpt4 book ai didi

javascript - 带有 Require.js 的 Javascript 库中的选择性功能

转载 作者:行者123 更新时间:2023-12-02 20:05:45 24 4
gpt4 key购买 nike

net.tutplus tutorial ,Andrew Burgess 提到 Rebecca Murphey 的评论“她会喜欢 JavaScript 世界,在这个世界中,您可以选择从何处获得功能:您可以从 jQuery 获得 DOM 操作,从 YUI 获得数组实用程序,从 Dojo 获得 UI 小部件等.”,然后他补充道,“今天尝试这个将是一场噩梦。但是,你猜怎么着?AMD 解决了这个问题”。不幸的是,这篇文章只是预览版,因此完整版本需要高级访问权限。有人知道该怎么做吗?

最佳答案

This总结一切。

Here's what I said in the tutorial:

In her talk “Modern JavaScript” at JSConf 2011, Rebecca Murphey said that she would love a JavaScript world where you could pick and choose where you get your functionality: you could get your DOM manipulation from jQuery, your array utilities from YUI, your UI widgets from Dojo, etc. Trying this today would be a nightmare. But, guess what? AMD solves this.

Now, I'm just realizing that when I said "AMD solves this," I made it sound like the problem was already solved. What I meant to say, however, was that if the library makers would use the AMD pattern for their libraries, and make each part of their libraries a separate module, then we'd be able to, as you say, pick DOM stuff from jQuery, array utils from YUI, etc. Right now, that isn't really possible, although I understand Dojo is using AMD now. And it's great to hear that jQuery is now AMD compatible!

TL;DR: It's not possible right now. I hope it will be in the future

关于javascript - 带有 Require.js 的 Javascript 库中的选择性功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7456231/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com