Answers for "jquery ajax datatype text json"

0

how to set json type jquery ajax

$.ajax({
            type: "POST",
            url: siteRoot + "api/SpaceGame/AddPlayer",
            async: false,
            data: JSON.stringify({ Name: playersShip.name, Credits: playersShip.credits }),
            contentType: "application/json",
            complete: function (data) {
            console.log(data);
            wait = false;
        }
    });
Posted by: Guest on June-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language