# inputEx-library

### inputEx 0.5.1

inputEx-library > inputEx > inputEx.YQL
Search:
Filters Show Private Show Protected Show Deprecated

## `static` Class inputEx.YQL

# inputEx YQL utility

Provide functions to run YQL javascript code and get results asynchronously.

YQL Execute is only available from a YQL request using a YQL Open Table XML file. This script uses a php (http://javascript.neyric.com/yql/js.php) to generate the wanted XML file from javascript code.

Examples:

- http://javascript.neyric.com/yql/js.php?url=http://gist.github.com/106503.txt
- http://javascript.neyric.com/yql/js.php?code=...jscode...

We use a classic JSONP hack to get the results via a callback method.

### Methods

#### init

`void init ( callbacks )`
Run script type="text/yql" tags on YQL servers If you have just one script tag and one callback, pass [[function(results) {}]] If you have two script tags and two callback for each: [ [function() {},function() {}] , [function() {},function() {}]] etc...

Parameters:
  `callbacks <Array>` Array of (list of callbacks functions) (provide a list of callbacks for each script type="text/yql" tag in the page)

#### initTrimpathPage

`void initTrimpathPage ( additionalCallbacks )`
YQL-trimpath-page is a utility to create pages using YQL queries ant Trimpath templating All YQL queries are made using the rpc/yql.js utility. see examples/yql-trimpath-page.html Call this method on page load to run yql queries and the associated templates

Parameters:
  `additionalCallbacks <Array>` List of [list of callbacks] (each yql query can call multiple callbacks)

#### query

`void query ( yql , callback )`
Generate the jsonp request to YQL

Parameters:
  `yql <String>` YQL query string
  `callback <Function>` Callback function

#### queryCode

`void queryCode ( codeStr , callback )`
Dynamically build a XML from javascript code and generate a dummy request for YQL

Parameters:
  `codeStr <String>` YQL-execute javascript code
  `callback <Function>` Callback function

#### queryUrl

`void queryUrl ( codeUrl , callback )`
Dynamically build a XML from a URL and generate a dummy request for YQL

Parameters:
  `codeUrl <String>` Url to a YQL-execute javascript file
  `callback <Function>` Callback function

Copyright © 2010 Eric Abouaf All rights reserved.