Commit ef27b8f7 by Greg Price

Make register button for marketing site break out of iframe

Use window.top.location.href instead of location.href for redirection.
parent 63612800
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
$('#class_enroll_form').on('ajax:complete', function(event, xhr) { $('#class_enroll_form').on('ajax:complete', function(event, xhr) {
if(xhr.status == 200) { if(xhr.status == 200) {
location.href = "${reverse('dashboard')}"; window.top.location.href = "${reverse('dashboard')}";
} else if (xhr.status == 403) { } else if (xhr.status == 403) {
location.href = "${reverse('register_user')}?course_id=${course.id}&enrollment_action=enroll"; window.top.location.href = "${reverse('register_user')}?course_id=${course.id}&enrollment_action=enroll";
} else { } else {
$('#register_error').html( $('#register_error').html(
(xhr.responseText ? xhr.responseText : 'An error occurred. Please try again later.') (xhr.responseText ? xhr.responseText : 'An error occurred. Please try again later.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment