yui

YUI AutoComplete events, how to?

佐手、 提交于 2019-12-04 05:06:55
I'm using YUI 3.3.0 and the AutoComplete widget. I'm entirely new to YUI. Here's the thing. I have AutoComplete working. How do I catch an event fired by AutoComplete? The documentation states that a select event is fired when a user selects an item from the list. I want to attach a function to that event. How do I do that? Here's an example for the plugin approach, http://tivac.com/yui3/so/skladjfyhafjk_autocomplete.htm Simply pass your event handlers as part of the config when you first plug autocomplete into the input. Y.one("#ac").plug(Y.Plugin.AutoComplete, { resultHighlighter:

java版的YUI3 combine服务-Combo Handler

匆匆过客 提交于 2019-12-04 01:08:17
YUI3中,为了避免js文件过大,各个功能模块是拆分的。它有一个“种子”的概念:先下载一个小的核心的js文件到浏览器端,再通过这个小的js文件去加载其它所需的模块。 这种按需加载虽然解决了单个js过大的问题,但是随之带来另外一个问题:如果一个页面使用了YUI的a、b、c功能,那么浏览器就要向服务器请求a.js、b.js、c.js三个文件,这样增加了浏览器向服务器的沟通次数。 为了解决后面的问题,YUI3又有一个combine的概念,预先下载的那个核心的js,把页面上需要的a、b、c模块合并成一个请求发给服务器,类似这样:http://mydomain.com/conbine?a.js&b.js&c.js。 这要求服务器接收到http://mydomain.com/conbine请求后,将参数取出来,找到对应的a、b、c的js文件,合并成一个js文件,返回给客户端。Combo Handler是Yahoo!开发的一个Apache模块,专门来干这个事情的。 如果只用java的web容器,可以把这项工作委托给servlet: <servlet> <servlet-name>yuicombo</servlet-name> <servlet-class>org.siqisource.mozo.servlets.YuiCombineServlet</servlet-class> <

YUI Autocomplete renders under other page elements in IE7

断了今生、忘了曾经 提交于 2019-12-03 22:45:14
I'm working now on a page that has a column of boxes styled with sexy shadows and corners and whatnot using the example here . I have to admit, I don't fully understand how that CSS works, but it looks great. Inside the topmost box is a text-type input used for searching. That search box is wired up to a YUI autocomplete widget. Everything works fine in Firefox3 on Mac, FF2 on Windows, Safari on Mac. In IE7 on WinXP, the autocomplete suggestions render underneath the round-cornered boxes, making all but the first one unreadable (although you can still see enough peeking out between boxes that

YUI CustomEvent no errors being reported

这一生的挚爱 提交于 2019-12-03 21:42:07
Does anyone know how to get the below to report a javascript error? (any browser) <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/yui/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"> </script> <script type="text/javascript"> ObjWithEvent = { testEvent: new YAHOO.util.CustomEvent("testEvent") }; ObjSubscriber = { handleTestEvent: function(){ alert('the next line will not show up in the error console'); not_a_valid_function_bro(); } }; ObjWithEvent.testEvent.subscribe(ObjSubscriber.handleTestEvent); ObjWithEvent.testEvent.fire(); </script> </head>

YUI Version Conflict Issue in Portlet

[亡魂溺海] 提交于 2019-12-03 21:27:44
问题 I'm loading yui.js 3.3.0 version file from portlet but liferay its using 3.2.0 yui.js file, so whenever i'm loading that page js errors are coming like G_ENV._loaded[VERSION] is undefined - this error is coming in yui.js which is liferay using that is 3.2.0 version. so its replacing value like G_ENV._loaded[3.2.0] and that will throw an error becoz we loaded 3.3.0 version from portlet. I replaced yui.js 3.2.0 version file in portlet but It was throwing some other js errors. How will it work

&& || 计算结果

匆匆过客 提交于 2019-12-03 20:26:42
1)&&表达式中左右都为真 var a = true; var b = 'haku'; console.log(a&&b);//haku 结果:返回右边的值 2)&&表达式中左为假,右为真 var a = false; var b = 'haku'; console.log(a&&b);//false 结果:返回左边的值 3)&&表达式中左为真,右为假 var a = 'yui'; var b = false; console.log(a&&b);//false 结果:返回右边的值 4)||表达式中左右都为真 var a = 'yui'; var b = 'haku'; console.log(a||b);//yui 结果:返回左边的值 5)||表达式中左为假,右为真 var a = false; var b = 'haku'; console.log(a||b);//haku 结果:返回右边的值 6)||表达式中左为真,右为假 var a = 'yui'; var b = false; console.log(a||b);//yui 结果:返回左边的值 备注 : 1.false、0、空字符串 结果一样 2.&&第一为假,取第一个的值,否则取第二个的值 ||第一个为真,取第一个的值,否则取第二个的值 来源: https://www.cnblogs.com/1024L/p

How do I call a basic YUI3 function from within a normal JavaScript function?

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'd like to call a simple YUI3 function from within a JavaScript function. Here is some code that does what I want in a very verbose way: function changeContent ( message ) { YUI (). use ( "node" , function ( Y ) { Y . all ( '#content-div' ). setContent ( message ); }); } Is there a better way to do this? NOTE: I don't want to attach this function to any event, I just want a global changeContent() function available. 回答1: If you want the API to exist outside of the YUI().use(...function (Y) { /* sandbox */ }), you can capture the

ASP.NET MVC HtmlHelper extensions for YUI controls (Yahoo User Interfaces)?

[亡魂溺海] 提交于 2019-12-03 10:14:25
问题 Has anyone written any HTMLHelper classes for MVC that help with Yahoo's User Interface Library? For instance I have written a helper method to convert a 'menu model' into the HTML markup needed to support the Yahoo Menu Control. The MVC pattern works well here because obviously if I chose to switch to a different menu implementation I can just write a new helper and not touch the model. This code works for me but isn't fully tested and you're welcome to use it. First we need a simple data

Compression issues with JQuery file in YUI Compressor

元气小坏坏 提交于 2019-12-03 09:37:49
I am trying to minify a few files with YUI compressor. However, I seem to be getting an error on 2 lines of code, which prevents compression. The .js file for jcarouselLite contains 1 error, and my own code contains the other. I have narrowed it down and in both occasions it looks like the the float property used in jQuery is causing this. The line is: li.css({overflow: "hidden", float: o.vertical ? "none" : "left"}); (jcarousellite) $("#now-playing .js-kit-rating div:first").css({width: "80px", float: "right"}).addClass("clearing"); (own code) A working example of the error can be seen by

Will existing JavaScript frameworks incorporate CommonJS?

旧街凉风 提交于 2019-12-03 09:14:31
问题 JavaScript frameworks like Prototype, jQuery, YUI, MooTools, Dojo, et al. all seem to target client-side developers, with the focus on enabling common user interaction patterns to be implemented more efficiently and with less code. With the emergence of server-side JavaScript, do these frameworks intend to incorporate the CommonJS standards to enable reuse of their library functions for server-side JavaScript, or will they allow alternative frameworks like Node and Narwhal to handle the