Skip to content

Instantly share code, notes, and snippets.

Created May 31, 2011 19:10
Show Gist options
  • Save anonymous/1001087 to your computer and use it in GitHub Desktop.
Save anonymous/1001087 to your computer and use it in GitHub Desktop.
<script>
//Get any tickets from view 22567988, outage Tickets that are currently open.
new Ajax.Request('/rules/22567988', {
method:'get',
asynchronous: true,
onSuccess: function(transport){
var obj = transport.responseText.evalJSON();
$('active-views').innerHTML = '<p>' + obj.length + ' current service outage.'
+ ' First outage is '
+ obj[0].subject + '</p>'
}
});
//Loop through the returned tickets to strip out and print ticket details.
for(var i=0;i<obj.length;i++){
document.write("<b>obj["+i+"] is </b>=>"+obj[i]+"<br>");
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment