New Landing How can we help? Cardinal Target Page With Jquery?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Cardinal
  • #164751
    Nhaugaard
    Member
    Post count: 164

    Hi guys,
    i just added the “are you sure you want to leave” popup when you navigate around the site. But how do i target the code to only one page? page-id-57?

    This is the code:

        jQuery(window).bind('beforeunload', function(){
            if( jQuery('input').val() !== '' ){
                return "It looks like you have input you haven't submitted."
            }
        });

    Thank you.

    #165007
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try to use this code:-

    jQuery(window).bind('beforeunload', function(){
    if(jQuery('body.page-id-57')){
            if( jQuery('input').val() !== '' ){
                return "It looks like you have input you haven't submitted."
            }
      }
    });

    Thanks
    Mohammad

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register