fixing the redirect again
This commit is contained in:
		
							parent
							
								
									cba16088c5
								
							
						
					
					
						commit
						db2209b7d1
					
				
					 1 changed files with 3 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -52,16 +52,9 @@
 | 
			
		|||
      }
 | 
			
		||||
 | 
			
		||||
      var xhr = new XMLHttpRequest();
 | 
			
		||||
      xhr.onreadystatechange = (e) => {
 | 
			
		||||
          if (xhr.readyState !== 4) {
 | 
			
		||||
              return;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          if (xhr.status === 200) {
 | 
			
		||||
              console.log('SUCCESS', xhr.responseText);
 | 
			
		||||
              window.location.href = "/thankyou/";
 | 
			
		||||
          } else {
 | 
			
		||||
              console.warn('request_error', xhr.responseText);
 | 
			
		||||
      xhr.onreadystatechange = function() {
 | 
			
		||||
          if (this.readyState == 4 && this.status == 200) {
 | 
			
		||||
              window.location.href = '/thankyou/';
 | 
			
		||||
          }
 | 
			
		||||
      };
 | 
			
		||||
      xhr.open("POST", "https://n8n.tfcconnection.org/webhook/health-form");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue