• Jquery click Custom Javascript

    1 vote Up Down

    On Aug 5, 2017 meir wrote:

    Hi Bookmark team, I was wondering how I can add javascript to the page and Jquery.

    I noticed that I can add <scripts> tags and javascript in the custom code modual, but when I tried to use Jquery .removeClass or .addClass I'm unable to. How could I do this, or otherwise add javascript into the page to add actions to buttons and other elements. 

    I tried this code unsuccesufully 

    $("#Elite").click(function() {

    This code however did work. 
     $("#Elite").click(function() {
    alert("The Button was clicked.");

    Thanks for the help. 

    1 Answer
    0 vote Up Down

    On Aug 8, 2017 justincredible wrote:

    When adding Jquery, it is best to add those scripts inside the backend, in the footer rather than inside the page itself.   Although the CSS can be loaded in a Code Module, javascript works a bit differently.   Since Jquery runs after the page is loaded, you'll want to add it directly above the closing < /body> tag.  So, i've found that in Bookmark,  it best to click on SETTINGS> SEO and in the footer section add the script tags with your code in between.  Let me know if you have more trouble.. happy to help

    answered 1 year ago