I am trying to edit a URL , that i sent in AJAX call.
function saveEdit() {
// logic for updating an existing item
$.ajax({
url: "https://localhost/api/1/databases/geolocation/collections/boom/"+globalData._id.$oid+"?apiKey=veTqID_gkb74tG-yL4MGcS1p2RRBP1Pf",
type: "PUT",
data: JSON.stringify({ Item:Item.value , Location: Location.value , Category: Category.value , Description : Description.value , Quantity: Quantity.value}),
contentType: "application/json"
});
In the above code i want to replace "localhost" from an IP , when the website is UP. I will read the IP from a config file.
Tried concatenating strings , did not work. Any suggestions?
Expected is :
https://x.x.x.x/api/1/databases/geolocation/collections/boom/