Regardless of having labored on the very advanced Firefox for quite a few years, I am going to at all times love plain previous console.log
debugging. Logging can present an audit path as occasions occur and textual content you’ll be able to share with others. Do you know that chrome supplies monitorEvents
and monitor
so that you could get a log every time an occasion happens or operate is named?
Monitor Occasions
Go a component and a collection of occasions to monitorEvents
to get a console log when the occasion occurs:
// Monitor any clicks inside the window monitorEvents(window, 'click on') // Monitor for keyup and keydown occasions on the physique monitorEvents(doc.physique, ['keyup', 'keydown'])
You possibly can move an array of occasions to pay attention for a number of occasions. The logged occasion
represents the identical occasion you’d see when you manually known as addEventListener
.
Monitor Perform Calls
The monitor
technique permits you to pay attention for calls on a particular operate:
// Outline a pattern operate operate myFn() { } // Monitor it monitor(myFn) // Utilization 1: Primary name myFn() // operate myFn known as // Utilization 2: Arguments myFn(1) // operate myFn known as with arguments: 1
I actually like you can view the arguments offered, which is nice for inspecting.
I often go for logpoints as an alternative of embedding console
statements in code, however monitor
and monitorEvents
present an alternative choice to each.
Responsive Pictures: The Final Information
Chances are high that any Internet designers utilizing our Ghostlab browser testing app, which permits seamless testing throughout all units concurrently, could have labored with responsive design in some form or type. And as right now’s web sites and units develop into ever extra various, a plethora of responsive pictures…
LightFace: Fb Lightbox for MooTools
One of many net elements I’ve at all times beloved has been Fb’s modal dialog. This “lightbox” is not like others: no darkish overlay, no obnoxious animating to measurement, and it does not attempt to do “an excessive amount of.” With Fb’s dialog in thoughts, I’ve created LightFace: a Fb lightbox…
CSS Textual content Overlap
One of many essential capabilities of CSS is to place parts.
Margin
,padding
,high
,left
,proper
,backside
,place
, andz-index
are just some of the key gamers in CSS positioning. Through the use of the above spacing…Spyjax: Ajax For Evil Utilizing Dojo
The thought of Spyjax is nothing new. In pasts posts I’ve coated how one can spy in your person’s historical past with each MooTools and jQuery. Right this moment we’ll cowl how you can examine person historical past utilizing the Dojo Toolkit. The HTML For the sake of this…
Supply hyperlink