Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig O'Mahony 364 posts 918 karma points
    Dec 18, 2017 @ 11:08
    Craig O'Mahony
    0

    Custom Tab not firing click event

    Hi folks,

    I wonder if someone could help me out please. Basically I've created a custom section in the Umbraco back office. When this section is selected a htm page is loaded in.

    enter image description here

    This HTM page has a clickable link in there but when the link is clicked the scripting that I've chained the event isn't firing i.e. It's just behaving link a normal link.

    <p>This is the salesforce loading page</p>
    
    <a id="clickME" href="#">Click Me</a>
    
    
    <script>
        $('#clickME').click(function (e) {
            e.preventDefault();
            alert("Button Clicked");
        }
    </script>
    

    Could anybody assist please?

    Thanks, C

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Dec 18, 2017 @ 15:27
    Markus Johansson
    0

    Hi!

    It looks like the eventhandler that you are creating should work.... not sure - have you looked at the console-out? Any errors?

    I would recommend you to implement a AngularJS-controller and use that for your front end and skit jQuery.

    I've blogged about this here: http://www.enkelmedia.se/blogg/2013/11/22/custom-sections-in-umbraco-7-%E2%80%93-part-2-the-views.aspx

    Note that the scripts are inline in the view - you should consider to move them you a js-file and add that file to your package.manifest-file so that Umbracos backoffice loads the file.

  • Craig O'Mahony 364 posts 918 karma points
    Dec 18, 2017 @ 17:13
    Craig O'Mahony
    0

    Hi Markus,

    Thanks for your input here and I shall certainly have a look into that link and report back.

    Thanks, C

Please Sign in or register to post replies

Write your reply to:

Draft