How to rewrite this to work with IE

Discussion in 'Javascript' started by samuel-coding, Sep 12, 2019 at 11:09 AM.

  1. samuel-coding

    samuel-coding

    Joined:
    Thursday
    Messages:
    2
    Likes Received:
    0
    Code (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: Sep 13, 2019 at 10:04 AM
    samuel-coding, Sep 12, 2019 at 11:09 AM
    #1
    1. Advertisements

  2. samuel-coding

    samuel-coding

    Joined:
    Thursday
    Messages:
    2
    Likes Received:
    0
    The error i receive in IE is this: Object doesn't support this action
     
    samuel-coding, Sep 12, 2019 at 11:11 AM
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.