Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

HTML
Standard deviation: <span id="confiReport"></span>


<script><script type="application/javascript">
  AJS.toInit(function() {
	var isPageEdit = AJS.$('#content').hasClass('page edit');	


    if (!isPageEdit) {
      var url = 'https://wiki.vertuna.com/ajax/confiforms/rest/filter.action?pageId=52625840&f=f&q=';
	  var xhr = AJS.$.ajax({
  		url: url,
  		timeout: 10000, // 10 sec
  		success: function (data) {
            var total = 0;
            var rows = data.list.entry;
			for (i=0;i<rows.length;i++) {
				total = total + rows[i].fields.d;
            }
            AJS.$('#confiReport').append(total);
    		console.log(data);
  		},
  		error: function (jqXHR, textStatus, errorThrown) {
    		console.log('request to get data from ConfiForms has failed... ' + textStatus);
  		}
	});
   }

  });
</script>