47
edits
(→parser) |
|||
| Line 29: | Line 29: | ||
The parser makes it easy for you as a developer to provide an interactive preview with search results, consistent with other Ubiquity search commands. | The parser makes it easy for you as a developer to provide an interactive preview with search results, consistent with other Ubiquity search commands. | ||
Via a number of options, you can tell | Via a number of options, you can tell mSC how to parse the data returned by the search provider. | ||
'''NB:''' all selectors used in the following sections are | '''NB:''' all selectors used in the following sections are either paths into the json data in dot-notation, or [http://docs.jquery.com/Selectors jQuery selectors]. Note that the latter are '''''NOT''''' CSS selectors albeit very similar. Some features you might be used to from CSS are missing, whilst others still are added. Which you should use depend on your choice of [[#type]] | ||
==== type ==== | |||
mSC supports two types of parsers, namely "json" and "html". If not specified, it assumes you want the html parser. | |||
==== container ==== | ==== container ==== | ||
If using the html parser, this must be a selector that matches each result, thus returning a list of result containers. When using the json parser it must match the parent of all the results, ie: "responseData.results". | |||
It is important to note that all details for each individual result must be contained in each container. | It is important to note that in the case of the html parser, all details for each individual result must be contained in each container. | ||
==== title ==== | ==== title ==== | ||
| Line 49: | Line 52: | ||
==== baseurl ==== | ==== baseurl ==== | ||
== Examples == | == Examples == | ||
edits