JSON
9.3
Example
This example shows how to create a web page that fetches Module Name and CPU load from
the module and presents it on the web page. The file, containing this code, has to be stored in
the built-in file system, and the result can be seen in a common browser.
<html>
<head>
<title>Anybus CompactCom</title>
<!-- Imported libs -->
<script type="text/javascript" src="vfs/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="vfs/js/tmpl.js"></script>
</head>
<body>
<div id="info-content"></div>
<script type="text/x-tmpl" id="tmpl-info">
</script>
<script type="text/javascript">
</script>
</body>
</html>
Anybus CompactCom 40 EtherNet/IP Network Guide
<b>From info.json</b><br>
Module name:
{%=o.modulename%}<br>
CPU Load:
{%=o.cpuload%}%<br>
$.getJSON( "/module/info.json", null, function(data){
$("#info-content").html( tmpl("tmpl-info", data ) );
});
72 (218)
SCM-1202-031 -EN 1.6
Need help?
Do you have a question about the CompactCom 40 and is the answer not in the manual?
Questions and answers