Skip to content

Author: admin@master

Communication between tabs or windows

I was searching for a way how to communicate between multiple tabs or windows in a browser (on the same domain, not CORS) without leaving traces. There were several solutions: using the window object postMessage cookies localStorage The first is probably the worst solution – you need to open a window fr…

How to use querySelectorAll and getAttribute?

I have this HTML file … … and this javascript source file … … and when I fill out the form and click the button I get this result: Everthing is “null” 🙁 What am I doing wrong here? Answer You need to quote the values in getAttribute As name and value are native to the dom e…

How do I bind react events from a mixin?

I want to write a simple mixin for a tooltip. I already know how to bind my mixin to DOM events: …but I’d like to bind to the React events instead, to take advantage of its consistent event system. How do I do it? Answer I think you probably want to do this in the render method of the mixing

Remove class on collapse (jquery)

I tried looking for an answer, but none of it has solved my problem yet. I am a beginner in learning to understand this code language and I think that my problem lies there. I have created a JSFiddle with what I have up until now. (http://jsfiddle.net/fxmcb5yv/2/)! This is my problem: When the div expands, it…

How to decode nock recorded response

How to ad-hoc decode/uncompress the output produced by the nock recorder so we can see the response as text? I guess we do not understand if the response is gzipped and/or encoded The object works find when we load it into nock, and our tests are behaving as we expect. To see what the API produced, we are hav…

typescript – cloning object

I have a super class that is the parent (Entity) for many subclass (Customer, Product, ProductCategory…) I’m looking to clone dynamically an object that contains different sub objects in Typescript. In example : a Customer that has different Product who has a ProductCategory In order to clone the …