Post JSON with JQuery

in steemcodeit •  6 years ago  (edited)

Send JSON POST data with JQuery:

 $.ajax
    ({
        type: "POST",
        url: 'example.php',
        dataType: 'json',
        async: false,
        contentType: 'application/json',
        data: JSON.stringify({ "myid": 1 , "mydata" : "Hello World!" }),
        success: function () {
                    console.log("Success"); 
        }
    });
        
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!