That's the problem:
in console.log msg displays, but when it comes to the redirect, it gives out is not defined. Probably trouble in the visibility zones of variables. Help...

Below is the code

 success: function (msg) { $.fancybox('<div class="popup popup_sucsess"><p class="popup-title">Заявка принята!</p><p class="sucsess_text">Наш менеджер свяжется с вами в ближайшее время.<br/>Через <span class="size16">3</span> секунды Вы будете перенаправлены на страницу для оплаты.</p></div>', { 'transitionIn': 'fade', 'transitionOut': 'fade', 'speedIn': 300, 'speedOut': 300, 'padding': 0, 'overlayColor': '#0080b0', 'overlayOpacity': 0.4, 'showNavArrows' : false }); setTimeout( 'document.location.replace(msg)', 3000 ); } 
  • Variable msg what contains? Is there any? - MAXOPKA
  • yes there is a redirect address on robokasa - Maks Devda
  • output to the console quietly - Maks Devda
  • Make console.log(msg) - see what will be in the console. - MAXOPKA
  • did gives the line with the url everything as it should be - Maks Devda

1 answer 1

Well, yes, the function is set with the help of a string (why do it at all?), And the information about the namespace is lost. It is necessary to set through the function.

 setTimeout(function(){document.location.replace(msg)}, 3000); 
  • Thank you very much. Just the night I'm drowning. With myself in shock) - Maks Devda