How to rewrite this to work with IE

Joined
Sep 12, 2019
Messages
2
Reaction score
0
JavaScript:
jQuery( document ).ready( function () {
    if ( 0 != jQuery( '#loginform' ).length ) {
        jQuery( '#loginform' ).attr( 'action', '<?php echo esc_js( $post_url ) ?>' );
        jQuery( '#loginform .login-password' ).remove();
        jQuery( '#loginform' ).append( '<input type="hidden" name="action" value="send_passwordless_email">' );
        jQuery( '#loginform .login-username label' ).text( 'Email' );
        jQuery( '#loginform .login-username input' ).attr( 'name', 'user_login' );
        jQuery( '#loginform .login-submit input.button' ).val( 'Email me my link' );
        var url_string = window.location.href;
        var url = new URL(url_string);
        var email = url.searchParams.get("email");
        var notfound = url.searchParams.get("notfound");
        if ( null != email ) {
            jQuery( '#loginform .login-username input' ).val( email );
            var html = '';
            if ( notfound ) {
                html += '<b style="color:red">We could not find a user with an email ' + email +' </b><br>';
                html += 'Please register for a FREE new account using the orange button.'
            } else {
                html += '<b>Please check your email</b><br>';
                html += 'We have sent an email to you (' + email + ').<br>';
                html += 'It will have a Link that will log you in';
            }
            jQuery( '#loginform' ).append( '<div id="login_popup"><p>' + html + '</p></div>' );
        }
    }
} );
 
Last edited by a moderator:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top