73
edits
m (→Adding bodies) |
|||
| Line 211: | Line 211: | ||
</pre> | </pre> | ||
=== Using functions in the parser === | === Parsing XML / Using functions in the parser === | ||
<pre> | <pre> | ||
CmdUtils.makeSearchCommand({ | CmdUtils.makeSearchCommand({ | ||
| Line 220: | Line 220: | ||
container: "simpleforecast > forecastday", | container: "simpleforecast > forecastday", | ||
title: "pretty", | title: "pretty", | ||
body: "conditions", | body: function() $("<div>").append( | ||
$("conditions", this), "<br/>", | |||
$("<b>", { | |||
text: $("low > celsius", this).text() + "\u2103", | |||
style: "color:#66f", | |||
}), | |||
" \uFF5E ", | |||
$("<b>", { | |||
text: $("high > celsius", this).text() + "\u2103", | |||
style: "color:#f66", | |||
})), | |||
thumbnail: function() $("<img>", { | thumbnail: function() $("<img>", { | ||
src: | src: "http://icons-pe.wxug.com/i/c/a/" + $("icon", this).text() + ".gif", | ||
}), | }), | ||
}, | }, | ||
edits