Click here to Skip to main content
15,895,793 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
JavaScript
$.ajax( { 
    url: 'https://api.mlab.com/api/1/databases/my-db/collections/my-coll?apiKey=myAPIKey&q={"_id":1234}',
    data: JSON.stringify( { "$set" : { "x" : 3 } } ),
    type: "PUT",
    contentType: "application/json" } );


What I have tried:

I tried online but can not find any solution for this.
Posted
Updated 1-Mar-16 1:31am
v2
Comments
Sinisa Hajnal 1-Mar-16 6:08am    
You cannot convert it into *simple* javascript. jQuery abstracts lots of details into that one call.
But you could try
http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp
http://www.w3schools.com/json/json_http.asp

1 solution

That simple call of JQuery encloses some 200 lines of code in 'simple' JavaScript...To write it, you have to learn a lot about AJAX and cross-browser compatibility...So start there...
(But while you are reading think about the WHY?...Why do such a foolish think)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900