• Resolved Norbert32

    (@dodude)


    EDIT: Never mind, I see now that I was on the wrong path altogether. Someone can delete this post.

    Hi everyone,

    Newbie question: I’m using the Code Snippets plugin to try and add some simple self made scripting to my site.

    In one of these, my objective is to make some edits to the homepage DOM. The script is hooked on ‘shutdown’ in order to be fairly sure the DOM will be rendered allright.

    I’m having trouble accessing the DOM however, for instance i have:

    $links = document.getElementsByTagName(“a”);

    …but it errors, saying: Undefined constant “document”

    How can I access the DOM correctly from a code snippet?

    • This topic was modified 4 years ago by Norbert32.
    • This topic was modified 4 years ago by Norbert32.
    • This topic was modified 4 years ago by Norbert32.
    • This topic was modified 4 years ago by Norbert32.

The topic ‘Trouble accessing DOM from code snippet’ is closed to new replies.