<!--
If your are willing to add another small library (named kLib) in the page,
then you can use this solution.
You can download the library from
https:
Check out the CodeProject article about kLib for more details.
-->
<script type="text/javascript">
function successResponse(response) {
var data = response.getsearchresultdataResult,
node = document.getElementById("showresult"),
odd = true,
tr;
var table = node.addChElem('table');
for (var i = 0; i < data.length; i++) {
tr = (odd) ? 'tr.oddTr' : 'tr.evenTr';
odd = !odd;
var t = table.addChElemTree([tr,['nm=td','adr=td','td',['ip=input'],'ph=td']]);
t.nodes.nm.addChTxtNd(data[i].service_provider_name);
t.nodes.adr.addChTxtNd(data[i].address_text + ", " + data[i].city_name + ", " + data[i].state_name + ", " + data[i].postal_code);
t.nodes.ip.setAttr({
type: 'button',
value: 'My Button'
}).onclick = function (){
}
t.nodes.ph.addChTxtNd(data[i].phone_no);
}
}
</script>
<style type="text/css">
.oddTr {
color: black;
backround: white;
}
.evenTr {
color: white;
backround: black;
}
</style>