Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
        }
    });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #json #type #jquery #ajax
ADD COMMENT
Topic
Name
5+5 =