Current Position:Home > Run window.AddEventListener at startup in Design view

Run window.AddEventListener at startup in Design view

Update:11-30Source: network consolidation
Advertisement
Folks-
I am using the following function  in my page I wish to run at page startup.  Works fine in browsers, but not in Design view.
(function() {
window.addEventListener('load', function() {
prettyPrint();
}, false);
This does not seem to be executing as  prettyPrint() is not being called in Design view as the CSS is not being applied.  Any ideas how to get this to execute properly?
Thanks-
Matt
PS-No idea why the code pasted in as table.

The Best Answer

Advertisement
Scripts don't execute in Design View.
If you want to see a script in DW, you can try the Live View, but even that has issues. Preview in Browser is truly your best bet for seeing what your code does.