no DOM in wordpress admin
- by Chris
I correctly inserted a javascript file into the wordPress admin with :
wp_enqueue_script()
I know that the script is loading. I tested it with an alert().
I then found that I am unable to access the DOM. When I tried :
document.getElementsByTagName('body')[0].addEventListener('load', function() {});
This error was:
Uncaught TypeError: Cannot call method 'addEventListener' of undefined
This is the first time I have used 'settings api' or inserted scripts into the WordPress admin.