Skip to main content
se eliminaron 6 caracteres en el cuerpo
Origen Enlace
 
function guardar_logo_emp(){
     

    let Dat_per_ad_consultform = document.getElementByIdquerySelector('data_per_ad''form[name="valid_logo"]');
     
 let form = documentform.querySelectorappend('form[name="valid_logo"]'data_per_ad, Dat_per_ad_consult);   
     let fd = new FormData(form);
   
   fd.append('data_per_ad', Dat_per_ad_consult); 

     let A = document.getElementById('guardar_logo_emp');
     let B = document.getElementById('loadingTodos');
     let ajax = xmlhttp();
                var url = 'guardar_logo_emp.php';
        
    let button = document.querySelector(".button_submit");
        button.classList.add("disabled");
    
        ajax.onreadystatechange=function(){
            
                    
                if(ajax.readyState==1){
                      B.innerHTML = "";
                        A.innerHTML = loading;
                    }
                if(ajax.readyState==4){
                    
                        A.innerHTML = ajax.responseText;
                        B.innerHTML = "";
                    
let cam_anim = document.querySelector("#guardar_logo_emp");
let Animar_now = cam_anim.classList.contains("animation_act");                  
    
            if (Animar_now==true){

    cam_anim.classList.remove("animation_act");
    cam_anim.classList.add("animation_off"); 
    
        setTimeout(reanimar,2000);
        
    function reanimar(){    
                
    button.classList.remove("disabled");            
                
    cam_anim.classList.remove("animation_off");
    cam_anim.classList.add("animation_act");
    }
        
    }                   
                
window.scrollTo(0,550); 

                }
            } 

             ajax.open("POST", url);
        ajax.send(fd);      
}

acabo de ver que con append se podria pero no logro hacerlo

CODIGO EDITADO CON EL PROBLEMA YA SOLUCIONADO

function guardar_logo_emp(){
    
    let Dat_per_ad_consult = document.getElementById('data_per_ad');
     let form = document.querySelector('form[name="valid_logo"]');   
     let fd = new FormData(form);
     fd.append('data_per_ad', Dat_per_ad_consult);
     let A = document.getElementById('guardar_logo_emp');
     let B = document.getElementById('loadingTodos');
     let ajax = xmlhttp();
                var url = 'guardar_logo_emp.php';
        
    let button = document.querySelector(".button_submit");
        button.classList.add("disabled");
    
        ajax.onreadystatechange=function(){
            
                    
                if(ajax.readyState==1){
                      B.innerHTML = "";
                        A.innerHTML = loading;
                    }
                if(ajax.readyState==4){
                    
                        A.innerHTML = ajax.responseText;
                        B.innerHTML = "";
                    
let cam_anim = document.querySelector("#guardar_logo_emp");
let Animar_now = cam_anim.classList.contains("animation_act");                  
    
            if (Animar_now==true){

    cam_anim.classList.remove("animation_act");
    cam_anim.classList.add("animation_off"); 
    
        setTimeout(reanimar,2000);
        
    function reanimar(){    
                
    button.classList.remove("disabled");            
                
    cam_anim.classList.remove("animation_off");
    cam_anim.classList.add("animation_act");
    }
        
    }                   
                
window.scrollTo(0,550); 

                }
            } 

             ajax.open("POST", url);
        ajax.send(fd);      
}

acabo de ver que con append se podria pero no logro hacerlo

 
function guardar_logo_emp(){
     

    let form = document.querySelector('form[name="valid_logo"]');    
    form.append(data_per_ad, Dat_per_ad_consult);
     let fd = new FormData(form);
 
     

     let A = document.getElementById('guardar_logo_emp');
     let B = document.getElementById('loadingTodos');
     let ajax = xmlhttp();
                var url = 'guardar_logo_emp.php';
        
    let button = document.querySelector(".button_submit");
        button.classList.add("disabled");
    
        ajax.onreadystatechange=function(){
            
                    
                if(ajax.readyState==1){
                      B.innerHTML = "";
                        A.innerHTML = loading;
                    }
                if(ajax.readyState==4){
                    
                        A.innerHTML = ajax.responseText;
                        B.innerHTML = "";
                    
let cam_anim = document.querySelector("#guardar_logo_emp");
let Animar_now = cam_anim.classList.contains("animation_act");                  
    
            if (Animar_now==true){

    cam_anim.classList.remove("animation_act");
    cam_anim.classList.add("animation_off"); 
    
        setTimeout(reanimar,2000);
        
    function reanimar(){    
                
    button.classList.remove("disabled");            
                
    cam_anim.classList.remove("animation_off");
    cam_anim.classList.add("animation_act");
    }
        
    }                   
                
window.scrollTo(0,550); 

                }
            } 

             ajax.open("POST", url);
        ajax.send(fd);      
}

acabo de ver que con append se podria pero no logro hacerlo

CODIGO EDITADO CON EL PROBLEMA YA SOLUCIONADO

se añadieron 19 caracteres en el cuerpo
Origen Enlace
function guardar_logo_emp(){
    
    let Dat_per_ad_consult = document.getElementById('data_per_ad');
    let form = document.querySelector('form[name="valid_logo"]');   
 
     let fd = new FormData(form);
     fd.append('data_per_ad', Dat_per_ad_consult);
     let A = document.getElementById('guardar_logo_emp');
     let B = document.getElementById('loadingTodos');
     let ajax = xmlhttp();
                var url = 'guardar_logo_emp.php';
        
    let button = document.querySelector(".button_submit");
        button.classList.add("disabled");
    
        ajax.onreadystatechange=function(){
            
                    
                if(ajax.readyState==1){
                      B.innerHTML = "";
                        A.innerHTML = loading;
                    }
                if(ajax.readyState==4){
                    
                        A.innerHTML = ajax.responseText;
                        B.innerHTML = "";       
     
                
let cam_anim = document.querySelector("#guardar_logo_emp");
let Animar_now = cam_anim.classList.contains("animation_act");                              
                    
            if (Animar_now==true){
    
    cam_anim.classList.remove("animation_act");
    cam_anim.classList.add("animation_off"); 
    
        setTimeout(reanimar,2000);
        
    function reanimar(){    
                
    button.classList.remove("disabled");            
                
    cam_anim.classList.remove("animation_off");
    cam_anim.classList.add("animation_act");
    }
        
    }                   
                    
                    
window.scrollTo(0,550); 
                    
    
                    
                    
                    
        
                }
            } 
        
    
             ajax.open("POST", url);
        ajax.send(fd+'&data_per_ad='+(Dat_per_ad_consult).valuefd);   
    
}

acabo de ver que con append se podria pero no logro hacerlo

function guardar_logo_emp(){
    
    let Dat_per_ad_consult = document.getElementById('data_per_ad');
    let form = document.querySelector('form[name="valid_logo"]');   
 
     let fd = new FormData(form);
     let A = document.getElementById('guardar_logo_emp');
     let B = document.getElementById('loadingTodos');
     let ajax = xmlhttp();
                var url = 'guardar_logo_emp.php';
        
    let button = document.querySelector(".button_submit");
        button.classList.add("disabled");
    
        ajax.onreadystatechange=function(){     
                    
                if(ajax.readyState==1){
                      B.innerHTML = "";
                        A.innerHTML = loading;
                    }
                if(ajax.readyState==4){
                    
                        A.innerHTML = ajax.responseText;
                        B.innerHTML = "";           
                
let cam_anim = document.querySelector("#guardar_logo_emp");
let Animar_now = cam_anim.classList.contains("animation_act");                              
                    
            if (Animar_now==true){
    
    cam_anim.classList.remove("animation_act");
    cam_anim.classList.add("animation_off"); 
    
        setTimeout(reanimar,2000);
        
    function reanimar(){    
                
    button.classList.remove("disabled");            
                
    cam_anim.classList.remove("animation_off");
    cam_anim.classList.add("animation_act");
    }
        
    }                   
                    
                    
window.scrollTo(0,550); 
                    
    
                    
                    
                    
        
                }
            } 
        
    
             ajax.open("POST", url);
        ajax.send(fd+'&data_per_ad='+(Dat_per_ad_consult).value);   
    
}
function guardar_logo_emp(){
    
    let Dat_per_ad_consult = document.getElementById('data_per_ad');
    let form = document.querySelector('form[name="valid_logo"]');   
     let fd = new FormData(form);
     fd.append('data_per_ad', Dat_per_ad_consult);
     let A = document.getElementById('guardar_logo_emp');
     let B = document.getElementById('loadingTodos');
     let ajax = xmlhttp();
                var url = 'guardar_logo_emp.php';
        
    let button = document.querySelector(".button_submit");
        button.classList.add("disabled");
    
        ajax.onreadystatechange=function(){
            
                    
                if(ajax.readyState==1){
                      B.innerHTML = "";
                        A.innerHTML = loading;
                    }
                if(ajax.readyState==4){
                    
                        A.innerHTML = ajax.responseText;
                        B.innerHTML = ""; 
                    
let cam_anim = document.querySelector("#guardar_logo_emp");
let Animar_now = cam_anim.classList.contains("animation_act");                  
    
            if (Animar_now==true){

    cam_anim.classList.remove("animation_act");
    cam_anim.classList.add("animation_off"); 
    
        setTimeout(reanimar,2000);
        
    function reanimar(){    
                
    button.classList.remove("disabled");            
                
    cam_anim.classList.remove("animation_off");
    cam_anim.classList.add("animation_act");
    }
        
    }                   
                
window.scrollTo(0,550); 

                }
            } 

             ajax.open("POST", url);
        ajax.send(fd);      
}

acabo de ver que con append se podria pero no logro hacerlo

se añadieron 6 caracteres en el cuerpo
Origen Enlace
Alfabravo
  • 9.9k
  • 5
  • 24
  • 32

function guardar_logo_emp(){

function guardar_logo_emp(){
    
    let Dat_per_ad_consult = document.getElementById('data_per_ad');
    let form = document.querySelector('form[name="valid_logo"]');   

     let fd = new FormData(form);
     let A = document.getElementById('guardar_logo_emp');
     let B = document.getElementById('loadingTodos');
     let ajax = xmlhttp();
                var url = 'guardar_logo_emp.php';
        
    let button = document.querySelector(".button_submit");
        button.classList.add("disabled");
    
        ajax.onreadystatechange=function(){     
                    
                if(ajax.readyState==1){
                      B.innerHTML = "";
                        A.innerHTML = loading;
                    }
                if(ajax.readyState==4){
                    
                        A.innerHTML = ajax.responseText;
                        B.innerHTML = "";           
                

let cam_anim = document.querySelector("#guardar_logo_emp"); let Animar_now = cam_anim.classList.contains("animation_act");

let cam_anim = document.querySelector("#guardar_logo_emp");
let Animar_now = cam_anim.classList.contains("animation_act");                              
                    
            if (Animar_now==true){
    
    cam_anim.classList.remove("animation_act");
    cam_anim.classList.add("animation_off"); 
    
        setTimeout(reanimar,2000);
        
    function reanimar(){    
                
    button.classList.remove("disabled");            
                
    cam_anim.classList.remove("animation_off");
    cam_anim.classList.add("animation_act");
    }
        
    }                   
                    
                    

window.scrollTo(0,550);

window.scrollTo(0,550); 
                    
    
                    
                    
                    
        
                }
            } 
        
    
             ajax.open("POST", url);
        ajax.send(fd+'&data_per_ad='+(Dat_per_ad_consult).value);   
    
}

}

function guardar_logo_emp(){

let Dat_per_ad_consult = document.getElementById('data_per_ad');
let form = document.querySelector('form[name="valid_logo"]');   

 let fd = new FormData(form);
 let A = document.getElementById('guardar_logo_emp');
 let B = document.getElementById('loadingTodos');
 let ajax = xmlhttp();
            var url = 'guardar_logo_emp.php';
    
let button = document.querySelector(".button_submit");
    button.classList.add("disabled");

    ajax.onreadystatechange=function(){     
                
            if(ajax.readyState==1){
                  B.innerHTML = "";
                    A.innerHTML = loading;
                }
            if(ajax.readyState==4){
                
                    A.innerHTML = ajax.responseText;
                    B.innerHTML = "";           
            

let cam_anim = document.querySelector("#guardar_logo_emp"); let Animar_now = cam_anim.classList.contains("animation_act");

        if (Animar_now==true){

cam_anim.classList.remove("animation_act");
cam_anim.classList.add("animation_off"); 

    setTimeout(reanimar,2000);
    
function reanimar(){    
            
button.classList.remove("disabled");            
            
cam_anim.classList.remove("animation_off");
cam_anim.classList.add("animation_act");
}
    
}                   
                
                

window.scrollTo(0,550);

            }
        } 
    

         ajax.open("POST", url);
    ajax.send(fd+'&data_per_ad='+(Dat_per_ad_consult).value);   

}

function guardar_logo_emp(){
    
    let Dat_per_ad_consult = document.getElementById('data_per_ad');
    let form = document.querySelector('form[name="valid_logo"]');   

     let fd = new FormData(form);
     let A = document.getElementById('guardar_logo_emp');
     let B = document.getElementById('loadingTodos');
     let ajax = xmlhttp();
                var url = 'guardar_logo_emp.php';
        
    let button = document.querySelector(".button_submit");
        button.classList.add("disabled");
    
        ajax.onreadystatechange=function(){     
                    
                if(ajax.readyState==1){
                      B.innerHTML = "";
                        A.innerHTML = loading;
                    }
                if(ajax.readyState==4){
                    
                        A.innerHTML = ajax.responseText;
                        B.innerHTML = "";           
                
let cam_anim = document.querySelector("#guardar_logo_emp");
let Animar_now = cam_anim.classList.contains("animation_act");                              
                    
            if (Animar_now==true){
    
    cam_anim.classList.remove("animation_act");
    cam_anim.classList.add("animation_off"); 
    
        setTimeout(reanimar,2000);
        
    function reanimar(){    
                
    button.classList.remove("disabled");            
                
    cam_anim.classList.remove("animation_off");
    cam_anim.classList.add("animation_act");
    }
        
    }                   
                    
                    
window.scrollTo(0,550); 
                    
    
                    
                    
                    
        
                }
            } 
        
    
             ajax.open("POST", url);
        ajax.send(fd+'&data_per_ad='+(Dat_per_ad_consult).value);   
    
}
Origen Enlace
Loading