Connect to TigerGraph using JQuery to Create, Read, Update and Delete Nodes and Relationships

Can you please provide an example of how to use JQuery and AJAX to connect to TigerGraph, and to then create, read, update and delete nodes and relationships?

Example JQuery AJAX:

$( document ).ready(function() {
  var api_url = 'https://api.linkpreview.net'
  var key = '5b578yg9yvi8sogirbvegoiufg9v9g579gviuiub8' // not real

  $( ".content a" ).each(function( index, element ) {

    $.ajax({
        url: api_url + "?key=" + key + " &q=" + $( this ).text(),
        contentType: "application/json",
        dataType: 'json',
        success: function(result){
            console.log(result);
        }
    })
  });
});

Thanks,
Martyn

What would the your-token-here value be? Where would I find that please?

When I try the above using the pwd for my tg database, I get the following type of error:

Access to XMLHttpRequest at ‘http://mygraph.i.tgcloud.io:9000/graph/MyDatabase’ from origin ‘http://mydomain.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.