I am looking for an answer how must I code a link to a AJAX popup window for users to login. I have my login link in a menu that is on all my pages. Also logout. I tried to read about this AJAX but I get very confused.

Thanks a lot! for helping me out with a simple answer.

1 Answer 1


Create a div. Throw your login box inside. Style and position it how you want. Set it to 'display: none'.

Create an event listener, which when triggered, sets the display property to block or anything but none.

Create a listener, which will set it to display none.

$( '.context' ).on( 'click', '.my_hidden_Div', function( event ) {
    $( this ).show();
 } );

$( '.context' ).on( 'click', '.my_hidden_div .close', function( event ) {
    $( this ).hide();
} );

Ajax login can be used, but if your having trouble this is a good start. Simple jQuery.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.