Two URLs in a function using "window.location.href"

I use Marketo Embed, for which I can add to it when I use it.

My goal is to use the window.location.href function to open the first URL (.zip file) and then open a new URL (page).

It uses only one URL. Any of them will work correctly if they are the only ones if function. Otherwise, it only launches the last one. I tested it and it all seems correct, but he thinks that I am missing something in the rules, using twice.

Here is my code:

<script src="//app-sj01.marketo.com/js/forms2/js/forms2.min.js"></script> <form id="mktoForm_1198"></form> <script>MktoForms2.loadForm("//marketo.com", "000-000-000", 0000, function(form) { form.onSuccess(function(values, followUpUrl) { window.location.href = "************.zip"; window.location.href = ".../page.html"; return false; });}); </script> 
0
source share
1 answer

to try

 <script src="//app-sj01.marketo.com/js/forms2/js/forms2.min.js"></script> <form id="mktoForm_1198"></form> <script> MktoForms2.loadForm("//marketo.com", "000-000-000", 0000, function(form) { form.onSuccess(function(values, followUpUrl) { var pid = window.setInterval(function() { window.location.href = ".../page.html"; typeof pid !== 'undefined' && window.clearInterval(pid); }, 1000); window.location.href = "************.zip"; return false ;}); }); </script> 
+1
source

Source: https://habr.com/ru/post/1270943/


All Articles