SyntaxFix
Write A Post
Hire A Developer
Questions
I encountered the same problem and checked for null but it did not help. Because the script was loading before page load. So just by placing the script before the end body tag solved the problem.