Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updateProfile (){
- console.debug("Updating profile");
- profile = createProfile(true);
- console.debug("Profile collected from web: ", profile);
- $.ajax({
- type : 'PUT',
- url : rootURLGlobal + 'updateProfile/' + $(".active").attr("id") + "/" + profile.name + "/" + roomURL,
- dataType : "json", // data type of response
- contentType : "application/json",
- data : JSON.stringify(profile),
- xhrFields : {
- withCredentials : true
- },
- async: false,
- success : function(data) {
- if (typeof (data) !== "undefined" && data != null) {
- if (data.messageType =="Success"){
- console.debug("Llamada REST updateProfile/" + profileName + "/" + roomURL, data);
- alertify.success("Escena actualizada correctamente.");
- initProFileConf();
- profileSettingsSaved = true;
- }
- else {
- console.error("Llamada REST updateProfile/: problema en el servidor", data);
- alertify.error("Error actualizando la escena");
- }
- } else{
- console.error("Llamada REST updateProfile/: respuesta incorrecta");
- alertify.error("Error actualizando la escena"+ data.description);
- }
- },
- error : function(error) {
- alertify.error("Error al actualizar el objeto escena");
- console.error("Error al actualizar el objeto escena", error);
- },
- beforeSend : function (data1) {
- $("#profileSettings").foggy();
- $("#loadProf").show();
- },
- complete : function (data2) {
- $("#loadProf").hide();
- $("#profileSettings").foggy(false);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement