JSON interview question
This is a simple interview tool
HTML
<h1>JSON dom manipluation test</h1>
<p>Given a jsonp endpoint of: "http://pc4460.roomandboard.com:8080/rnb/resources/feature_json.ftl?decorator=nowrap", please print each option's name in an unordered list. Please note that the service above expects a 'callback' parameter.</p>
<div id="option">
<!-- Put options here. -->
</div>
JavaScript
// solution
$.getJSON("https://pc4460.roomandboard.com:8080/rnb/resources/feature_json.ftl?callback=?&decorator=nowrap", function(data) {
var html = "<ul>";
$.each(data.options, function(i, option) {
html += "<li>" + option.name + "</li>";
});
html += "</ul>";
$("#option").append(html);
});