Create Parature ticket using javascript

I did not find any blog which gave detailed how you can create a parature ticket using javascript.

<script type=”text/javascript”>

function createCustomer()
{
var url = “https://demo.parature.com/api/useryourpath/Ticket”;
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(“myDiv”).innerHTML=xmlhttp.responseText;
}
}
var str = “<Ticket>” +
“<Ticket_Customer><Customer id=’10002′></Customer></Ticket_Customer>” +
“</Ticket>”;
xmlhttp.open(“POST”,url ,true);
xmlhttp.setRequestHeader(“Content-type”,”application/x-www-form-urlencoded”);
xmlhttp.send(str);
}

</script>
<div >
<input type=”button” onclick=”createCustomer()” value=”Submit”/>
</div>

Advertisements