JSFiddle - React, Tailwind, and code Playground

by Mobeen Sarwar

JavaScript

var user_name;
$.ajax({
  	url : "https://jsonplaceholder.typicode.com/users/1",
    method :  "GET",
    dataType : "json",
    success : function(responce){
    name = responce.name;
    },
    error:function(error){
    ajaxError='error in ajax request';
    alert(error);
    }
  });
  alert(ajaxError);