yui笔记

A broadcast of 2, indicating that event:landing should be broadcast globally. If
broadcast is 0, the event is received only by objects in the event’s bubble tree. A
value of 1 means that YUI also broadcasts the event to the top-level Y object, which
means Y.on() can handle the custom event. A value of 2 means that the event is
also broadcast to the Y.Global object, which means any YUI instance on the page
can respond to the event. Events fired from an EventTarget have a default broadcast

of 0.


One subtle point to think about is whether to define event behavior for an entire class,
or only for particular instances. In the example, CommandModule and MissionControl set
their event listeners in their own initializer() function, which ensures that all instances
of CommandModule listen for eagle:joke. To define an event listener only for
a particular instance of CommandModule, you could call commandModule.on() in the
YUI().use().


Example 5-12. Scraping HTML with YQL

用YQL做部分页面抓取:

http://developer.yahoo.com/yql/guide/yql-select-xpath.html#html_table-using_xpath


var query = 'select * from html where url="{url}" and xpath="{xpath}"',
params = {};
params.url = 'http://kleinbottle.com/specs_for_nice_klein_bottles.htm';
params.xpath = '//table[1]/tr';
query = Y.Lang.sub(query, params);


响应式设计很赞

Example 6-6. Using Grids for responsive design

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值