Announcement

Collapse
No announcement yet.

Javascript Not Executing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Javascript Not Executing

    I've added the following elements to the client\res\templates\site\footer.tpl template:

    Code:
    <div class="scroll-to-top">
        <i class="icon-arrow-up"></i>
    </div>
    However, when I add the following Javascript to client\src\views\site\footer.js, I find that it never executes:

    Code:
    Espo.define('views/site/footer', 'view', function (Dep) {
    
        return Dep.extend({
    
            template: 'site/footer',
    
            events: {
                'click .scroll-to-top': function (e) {
                    alert('clicked');
                }
            }
        });
    
    });
    I've tried clearing the cache, I've inspected using Google Chrome developer tools (I'm working with isDeveloperMode => true) however the alert is never displayed.

    What am I missing?

  • #2
    Can anyone offer any help, please?

    Comment


    • #3
      I have tried your code, it working well! with no any problem

      you may paste the codes in a wrong files?
      you have to do as following:

      /client/res/templates/site/footer.tpl
      /client/src/views/site/footer.js
      CEO of Eblasoft
      EspoCRM Expert since 2014
      Full Stack Web Developer since 2008
      Creator of Numerous Successful Extensions & Projects​

      Comment

      Working...
      X