JavaScript on jsfiddle.net -


You will see a lot of this code below that is an addEventHandler function that runs on window load. If I want to test it on jsfiddle.net then how can I change this code, keeping in mind that the page does not load on jsfiddle.net is here

Please be aware That I am a newbie, so try to answer as much as possible. Thanks Function addEventHandler (Onode, EVT, OFFIC, BACKACTURE) {if (window.attachEvent) oNode.attachEvent ("+" + EVT, oFunc); Other Onod.Edit Listener (EVT, OFFIC, BICACHTURE); } Function getEventTarget (e) {if (window.event) returns window.Event.SeventElement; And e.target back; } Function div1Handler (evt) {var e = evt || Window.event; Var target = getEventTarget (e); Event handler for Var str = "div1, target:" + target.getAttribute ('id') + ", type:" + e.type; If (E.EventFace) str + = "; Step:" + E.EventFash; Warning (STR); If (e.cancelBubble! = Null) e.cancelBubble = true; E. Eastopprogation (); } Function div2Handler (evt) {var e = evt || Window.event; Var target = getEventTarget (e); Var str = "event handler for div2, target:" + target.getAttribute ('id') + ", type:" + e.type; If (E.EventFace) str + = "; Step:" + E.EventFash; Warning (STR); } Div3Handler (evt) function {var e = evt || Window.event; Var target = getEventTarget (e); Var str = "event handler for div3, target:" + target.getAttribute ('id') + ", type:" + e.type; If (E.EventFace) str + = "; Step:" + E.EventFash; Warning (STR); } Function BodyHandler (EVT) {var e = evt || Window.event; Var target = getEventTarget (e); Var str = "event handler for body, target:" + target.getAttribute ('id') + ", type:" + e.type; If (E.EventFace) str + = "; Step:" + E.EventFash; Warning (STR); } Function initializeHandlers () {addEventHandler (document.getElementsByTagName ("body") [0], "click", bodyHandler, false); AddEventHandler (document.getElementById ("div1"), "click", div1handler, false); AddEventHandler (document.getElementById ("DIV2"), "click", div2Handler, false); AddEventHandler (document.getElementById ("DIV3"), "click", div3handler, false); If (! Window.event) {addEventHandler (document.getElementsByTagName ("body") [0], "click", bodyHandler, true); AddEventHandler (document.getElementById ("div1"), "click", div1handler, true); AddEventHandler (document.getElementById ("DIV2"), "click", div2handler, true); AddEventHandler (document.getElementById ("DIV3"), "click", div3handler, true); }} AddEventHandler (window, "load", function (evt) {initializeHandlers ()});

Try it out:

What I've done is very simple is . I changed the two dropdown list to the left of JSF as shown below. changing JSfield to Settings

Previously you wrote this event on a mutual on-load event. My change was code placed on the top tag of the page without any rap. Understood?

Comments