Sample Code for parsing FAMIS web services

Javascript sample

<script type=”text/javascript” src=”https://famis.prod.uconn.edu/extlib/js/jqplot/jquery.js”>
<link href=”https://famis.prod.uconn.edu/extlib/js/jqplot/jquery.jqplot.css” rel=”stylesheet”>
<link href=”https://famis.prod.uconn.edu/extlib/js/jqplot/jquery.jqplot.min.css” rel=”stylesheet”>
<script type=”text/javascript” src=”https://famis.prod.uconn.edu/extlib/js/jqplot/jquery.min.js”>
<script type=’text/javascript’>

function doThis() { 

var UCONN_API_KEY = "xxxx&";

$.getJSON('/api/index.php?key=' + UCONN_API_KEY + 'method=SPACE_ROOM_DETAIL_BY_BLDG&format=json&value=0364', function (data) { 

var roomArray = new Array();
var roomsString = '' 

// If the returned data is an object do nothing, else try to parse 
roomArray = typeof data != 'object' ? JSON.parse(data) : data; 
for (var kk = 0; kk < roomArray.length; kk++) { 
roomsString = roomsString + "BLDG:" + roomArray[kk]['BLDG_NAME'] 
+ " FLOOR:" + roomArray[kk]['FLOOR'] 
+ " ROOM:" + roomArray[kk]['ROOM'] 
+ " SQR FEET:" + roomArray[kk]['SQR_FEET'] 
+ " DEPT_NAME:" + roomArray[kk]['DEPT_NAME'] 
+ " SPACE_TYPE:" + roomArray[kk]['SPACE_TYPE'] + "
"; 
} 

document.getElementById('writeHere').innerHTML = roomsString;
 } ); 
} 

$(document).ready(function () { console.log("Doc ready"); doThis(); });