Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1137270

    Hello,

    I need to add an onclick event to a column link and I’m not sure how to go about it. I have added custom_link as a class to the column and placed this script in my functions.php file but cant seem to get it to work.. Any help would be appreciated.

    function trigger_func_on_custom_button(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
        	$('.custom_click a').click(function(e){
        		e.preventDefault();
        		var con=confirm("This section of the website is under construction. Click here to continue to the archive site.");
            });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'trigger_func_on_custom_button');
    #1137772

    Hey smoke_house,
    I took a look at your script above and tested it on my localhost and it’s working for me.
    2019-09-12-233443
    Are you getting any errors in your browser console?

    Best regards,
    Mike

    #1156922

    Hi Mike,

    Sorry for the late reply. Unfortunately, I’m still struggling with this. I dont have any errors in my console.

    It seems as soon as I add content to the column the pop up fails.

    #1157460

    Hi,
    Please include an admin login in the Private Content area so we can take a look.

    Best regards,
    Mike

    #1158628

    Here you go.

    #1159139

    Hi,
    Thank you, I’m trying to research this more, thank you for your patience.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.