get_datalist_collection.php
shows usage of materials list
by veeuze
HTML
<script src="//integrate.materialo.com/v2.0/js/vendor/XMLDisplay.js"></script>
<link rel="stylesheet" href="//integrate.materialo.com/v2.0/css/vendor/XMLDisplay.css">
<div id="scriptname"></div>
<div id="output"></div>
CSS
body {
white-space: pre;
font-family: monospace;
}
#scriptname,
#output {
background-color: #fff;
padding: 10px;
}
iframe {
width: 100%;
height: 500px;
border: none;
}
JavaScript
// Please adjust the following variables to your liking:
var pimid = 477;
var frmt = "";
var dbg=0;
// end of adjustment
var scriptname = "https://integrate.materialo.com/v2.0/cust/daw/get_datalist_collection.php?pimid=" + pimid + "&frmt=" + frmt;
$('#scriptname').html("This is the script you are calling:\r\n" + scriptname);
if (dbg == 1) {
$("#output").html("<iframe src='" + scriptname + "'></iframe>");
} else
if (frmt == "xml") {
$('#output').html("This is the output:\r\n<div id='XMLHolder'></div>");
LoadXML("XMLHolder", scriptname);
} else {
$.ajax({
url: scriptname,
type: "GET",
error: function(jqXHR, textStatus, errorThrown) {
$("#output").html(jqXHR);
$("#output").append(textStatus + " ");
$("#output").append(errorThrown + " ");
},
success: function(data) {
$('#output').html(
"This is the output:\r\n" + JSON.stringify(data, null, 4));
},
datatype: "application/json"
});
}