Use GWS In JavaScript

The code below shows how the GPlates Web Service can be used in JavaScript. You might also want to check out the gplates-js at

var url = '';
var method = "GET"
var xhr = new XMLHttpRequest();
if("withCredentials" in xhr){, url, true);
}else if(typeof XDomainRequest != "undefined"){
xhr = new XDomainRequest();, url);
xhr = null;
if (!xhr) {
throw new Error('Does your web browser support CORS?');
xhr.onload = function() {
var text = xhr.responseText;
xhr.onerror = function() {
alert('something is wrong!');