jeet
jeet

Reputation: 95

jquery nyromodal close and redirect

I am using nyroModal plugin http://nyromodal.nyrodev.com/ to create a login modal. The idea is, once the user has logged in successfully, to close the nyromodal and redirect him/her to the another url?

Is that possible?

Thanks

jeet

Upvotes: 3

Views: 3010

Answers (2)

macgyver
macgyver

Reputation: 1279

You could add in nyroModal afterClose callback the code to redirect to a new url and all code according your needs, I think to read through an ajax call or from a cookie if user is successfully logged in:

$(document).ready(function(){

    $('.nyroModal').nyroModal({
        callbacks: {
            afterClose: function() {
                window.location.href = "http://newurl";
            }
        }
    });

});

Upvotes: 4

Tarek Fadel
Tarek Fadel

Reputation: 1959

This should do what you're looking for

function RefreshParent(){
    var url = window.parent.location.href;

    window.parent.location.href = url;
}

You'll need to include that piece of code to the login page (the one inside the nyroModal window)

Upvotes: 0

Related Questions