How to use find function in YUI3? And how to find meta tag list?

感情迁移 提交于 2019-12-06 15:25:02

问题


Like jQuery we can collect the array of matched DOM element of class 'anything'
with the help of 'find' function
Can i have same functionality in YUI3?

Edit 1:

As i have website source code with the help of php 'file_get_content' function
and i want to find the list of meta tag by YUI3.

Here i used module named
1. io-base : to get the website source code in ajax mode
2. node : to implement functionality over code.

May i know how to parse the responseText to get the list of meta tag?


回答1:


You can find the collection of all matched elements like this.

YUI().use('node', function(Y){
var myElements = Y.all('.classname');
});

If you are using the io module the user guides may help.

if the format of your response is something like json, you would include the json module and parse the responseText to json and then just treat it as an object. If it's xml that you get back use the responseXML returned via the io call and use the native xml dom functions. (The examples linked on the user guide shows just this type of work)

Also, if you are used to jQuery try the rosettastone site



来源:https://stackoverflow.com/questions/13796513/how-to-use-find-function-in-yui3-and-how-to-find-meta-tag-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!