Java Script
Event Handler
Create an event handler that runs the makeTree() function when the page loads.
ERROR
Unit TestIncomplete
Event handler runs makeTree() when the page loads
Test Output
window.onload 1) "before all" hook in "window.onload" ✓ runs the `makeTree` function 1 passing (347ms) 1 failing 1) window.onload "before all" hook in "window.onload": Error: done() called multiple times in hook <window.onload "before all" hook in "window.onload"> of file /root/sandboxb7d8e52b/nt-test-046a66a3.js; in addition, done() received error: TypeError: Cannot read property '_ownerDocument' of undefined at process._fatalException (internal/bootstrap/node.js:496:27) (node:1330) ExperimentalWarning: The fs.promises API is experimental
Code
"use strict";
//global variables declaration
var nodeCount=0;
var elemCount=0;
var textCount=0;
var wsCount=0;
//event to run fuction
window.onload=makeTree;
function makeTree() {
}
function makeBranches(treeNode, nestedList) {
}
function isWhiteSpaceNode(tString) {
return !(/[^\t\n\r ]/.test(tString));
}
As you see above I didn't get any error regarding window.onload. it executes perfectly for me. If this is not the question you asked or any quaries please comment. Thank you.
Get Answers For Free
Most questions answered within 1 hours.