URL Redirect

259 views
Skip to first unread message

Vishal Bhat

unread,
Mar 8, 2021, 12:48:17 PM3/8/21
to oTree help & discussion
Hi 

How can i use end links of my panel partner, once respondents completes the survey as i need to redirect the respondent from my survey to their end page?

Regards
Vishal 

Chris Crabbe

unread,
Mar 8, 2021, 1:26:12 PM3/8/21
to Vishal Bhat, oTree help & discussion
Hi Vishal -

I usually do this by adding a new Page to the end of my page_sequence, and then in the template of that page adding javascript in window.onload which sets the value of window.location.href to whatever URL I want to redirect to.

So something like:
<script>
    window.onload = function(){
        window.location.href="http://www.google.com";
    }
</script>

Thanks,
--Chris

--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/f7099b6d-9a8c-4393-87fb-d8031b1b88f5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages