Widget:CJP2: Difference between revisions

Jump to navigation Jump to search
Christopher Popma (talk | contribs)
No edit summary
Christopher Popma (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
query : '[[Pill Shape::Oval]]|?Pill Imprint|?Pill Dosage|?Pill Ingred|?Pill Color|?Pill Shape|?Pill Size (mm)|?Pill Scoring|?NDC|?Pill Name',
query : '[[Pill Shape::Oval]]|?Pill Imprint|?Pill Dosage|?Pill Ingred|?Pill Color|?Pill Shape|?Pill Size (mm)|?Pill Scoring|?NDC|?Pill Name',
format : 'json'
format : 'json'
}).always(function (data) {
},function(data) {alert("Data: " + data);});
                /*.always(function (data) {
$.each(data.query.results, function (index, value) {
$.each(data.query.results, function (index, value) {
//Assign variables the values returned from the function//
//Assign variables the values returned from the function//
Line 22: Line 23:
var ndc = value.printouts["NDC"];
var ndc = value.printouts["NDC"];
var pillName = value.printouts["Pill Name"];
var pillName = value.printouts["Pill Name"];
/*
//Find a <table> element with id="resultsTable-body":
//Find a <table> element with id="resultsTable-body":
var table = document.getElementById("resultsTable-body");
var table = document.getElementById("resultsTable-body");
Line 52: Line 53:
cellNDC.innerHTML = ndc;
cellNDC.innerHTML = ndc;
cellPillName.innerHTML = pillName;
cellPillName.innerHTML = pillName;
*/




Line 60: Line 61:
//Append the new row with the information.//
//Append the new row with the information.//
$('#resultsTable-body').innerHTML(newRow);
$('#resultsTable-body').innerHTML(newRow);
});
});  
});  
});*/
});   
});   
});  
});  

Latest revision as of 13:06, 3 June 2014