Difference between revisions of "MediaWiki:Sandbox.js"

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

Revision as of 06:13, 6 August 2019

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

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