Hi I have one yql query and i want that i pass variable in that query here is an example.This is a yql query and i want that the tr[1] value could be changed using varibale n whose value could be 1,2,3,4,5...n
select * from html where url="http://afghanskills.com/all-jobs.php" and xpath="//tbody/tr[1]/td/font"
Is that possible.
1 Answer
Accepted Answer
Yea, this is pretty straight forward javascript:
var win = Ti.UI.createWindow({ backgroundColor: '#13386c' }); var lbl = Ti.UI.createLabel({ text:'' }); win.add(lbl); var n = 1; var q = 'select * from html where url="http://afghanskills.com/all-jobs.php" and xpath="//tbody/tr['+n+']/td/font"'; Ti.Yahoo.yql(q,function(e) { lbl.text = JSON.stringify(e.data); }); win.open();
Your Answer
Think you can help? Login to answer this question!