Difference between revisions of "MediaWiki:Sandbox.js"

From Virtuverse Wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
     type: "GET",
 
     type: "GET",
 
     dataType: "json",
 
     dataType: "json",
     url: window.location.host+"/vv-api/get-creatures.php",
+
     url: window.location.hostname+"/vv-api/get-creatures.php",
 
     success: function(data) {
 
     success: function(data) {
 
         console.log(data);
 
         console.log(data);

Revision as of 06:10, 6 August 2019

$(document).ready(function() {

  $.ajax({
     type: "GET",
     dataType: "json",
     url: window.location.hostname+"/vv-api/get-creatures.php",
     success: function(data) {
        console.log(data);
     },
     error: function(status, exec) {
        console.log(status);
     }
  });

  $('#sandbox-output').html('Sandbox JS loaded!');
});