I have this script that sends values in form of string to the server to change the ipv4 information on a device need some help automatically changing the URL to the new address upon success of the post request without using the origin as the Parent URL. like in the case of window.location.replace(myUrl);
I get http://192.168.10.128/192.168.10.125
Where 125 is the new address.
$.ajax({
type : 'POST',
url : '/ipcfg/ipcfg_set.cgi',
dataType : 'json',
data : {
ipv4_addr : addr,
ipv4_mask : mask,
gw_addr : gw
},
success : function() {
var myUrl = encodeURI(addr);
window.location.replace(myUrl);
//document.location.href = myUrl;
//location.assign(href, myUrl);
console.log("sucesss");
},
error : function(xhr, type) {
console.log("failed" + type, +xhr);
}
});
}