jquery - Redirecting after Ajax post -


i want success on ajax post go home page. reason keep doing wrong. idea should fix this?

window.app_root_url = "<%= root_url %>"; 

ajax

$.ajax({ url: '#{addbank_bankaccts_path}',  type: 'post',  beforesend: function(xhr) {xhr.setrequestheader('x-csrf-token', '#{form_authenticity_token}')},  datatype: "json",  data: 'some_uri=' + response.data.uri ,  success: function(app_root_url) {       window.location.assign(app_root_url);   } }); 

success: function(response){                         window.location.href = response.redirect;                     } 

hope , had same problem


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -