YUI 上传器 2.6.0 示例
我试图简单地使用一些有关 YUI-Uploader 的示例和说明,但我对许多问题感到沮丧。
- “YUI Library: Uploader”备忘单的简单用例对我来说不起作用,因为除了
addListener()
之外列出的所有方法都不存在于 myUploader 对象上。 - 示例适用于版本 2.5.1,并包含一个方法称为
browse()
,它不仅在 2.6.0 版本中被删除,而且我找不到任何有关如何使用 2.5.1 版本(如果我选择)的文档。 - 我找不到
uploader.swf
文件的源 FLA,因此理论上可以诊断所有这些问题。
有没有人成功使用了 2.6.0 YUI Uploader,如果是的话,是否有一些我应该避免的常见干扰 JavaScript,或者可以遵循的更好的示例? 谢谢。
感谢您的回复。
我可能会注意到,在收到对此的任何回复之前,我已经完成了“上传器”项目。 我的问题部分是由于某些示例适用于 v2.5.1,另一部分是由于没有使用事件侦听器来查看组件何时准备就绪。 我从剖析 Flickr 所做的事情中得到了最多的帮助。
I'm trying to simply use some of the examples and instructions regarding the YUI-Uploader, and I'm being frustrated by a number of issues.
- The "YUI Library: Uploader" cheat sheet's simple use case doesn't work for me because all the listed methods except
addListener()
do not exist on the myUploader object. - The example is for version 2.5.1 and includes a method called
browse()
, which not only was removed in version 2.6.0 but I cannot find any documentation for how to use the 2.5.1 version if I so choose. - I can't find the source FLA to the
uploader.swf
file so that I could theoretically diagnose all these issues.
Has anyone successfully used the 2.6.0 YUI Uploader, and if so is there some common interfering JavaScript I should avoid, or a better example to follow? Thank you.
Thanks for the replies.
I might note that I finished my "uploader" project before receiving any responses to this.
Part of my problems were due to some of the examples being for v2.5.1 and another part were due to not using an event listener to see when the component was ready. I got the most help from just dissecting what Flickr did.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以找到
uploader.swf
的源代码 现在,YUI 源代码已在 GitHub 上提供,位于Uploader.as
。You can find the source to
uploader.swf
here atUploader.as
now that the YUI source is available on GitHub.对于这个简单的例子,您的链接是错误的,这是正确的链接。
YUI Uploader 简单示例
您也可以看一下如果您愿意的话,在我的实现中,它非常简单,并且使用 YUI 2.6.0 可以正常工作。
Tivac.com YUI 上传器实现
听起来#1 是您尝试调用上传器上的方法立即地。 您应该为它可以触发的所有事件添加侦听器,并在“contentReady”事件触发后进行任何配置。 所有 YUI 示例 & 我的就是这么做的,所以你可以在那里查看代码示例。
You've got the wrong link for the simple example, here's the correct one.
YUI Uploader Simple Example
You could also take a look at my implementation if you'd like, it's pretty barebones and works fine using YUI 2.6.0.
Tivac.com YUI Uploader Implementation
It sounds like for #1 that you're trying to call methods on the uploader immediately. You should instead add listeners for all the events it can fire and do any configuration once the "contentReady" event fires. All the YUI examples & mine do that, so you can check there for a code sample.