Unable to run JavaScript in app

About Support App Unable to run JavaScript in app

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #6482
    Avatar for kcclemokcclemo

    I am not able to get my JavaScript to work in the app. It works in my standard browser, but, not the app.

    Is there something special I need to do to get it to execute JavaScript?

    Note, I’m not using JQuery or any third-party plugins. Here is the code I’m attempting to run:
    document.addEventListener(“DOMContentLoaded”, function() {
    var today = new Date().getTime();
    var events = document.querySelectorAll(‘.event’);

    events.forEach(function(event) {
    var expires = new Date(event.getAttribute(‘data-expires’)).getTime();

    if (today < expires) {

    I’ve attempted both in-lining the JavaScript and referencing it as an external file but, neither works. Is there a way to debug the console errors I may be encountering?

    Avatar for Andy MoyleAndy Moyle

    You can use jQuery – I can read that better 😉
    It’s likely to be todo with the DOMContentLoaded having already fired by the time your code is rendered

    Avatar for kcclemokcclemo

    Ah… OK, that’s a good thought. I’ll give it a try. Thanks!

    Avatar for kcclemokcclemo

    That worked! Thanks again!

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