Skip to content

Tag: javascript

SweetAlert2 crappy text

I have a question about SweetAlert2. As you can see in this picture that’s how my swal2 looks, but on the official site or others the text is smoother, how should I fix this? Maybe I’ve forgot one CSS/JS? Screenshot: http://prntscr.com/jnoula Github / JSFiddle: http://prntscr.com/jnovyf Answer Swe…

Implementation of Promise.race()

I came across an implementation of the Promise.race() method in JavaScript, which works as expected, but doesn’t make much sense to me. How does the forEach loop end up assigning a specific promise’s functions? Answer By definition a promise resolves / rejects only once, no matter how often you ca…

Block onClick events

Is it possible to block in some time frame (in the example 1s) onClick events after trigger? 0s: onClickEvent 200ms: Block the event 752ms: Block the event 1.2s: OnClickEvent 2.3s: OnClickEvent 2.6s: Block the event How can I do without timers? Answer Just prevent the event from propagating to other handlers.

A hyperlink download attribute not working

so i have this problem with hyperlink attribute download. basically i have link that download a certain file. however it doesnt work.. With this format, it will download the file but it will give me an failed file says ‘no file’. On the other hand if i have link that has a complete uri format: It …

Post Effects and Transparent background in three.js

Trying to use the transparent background with some post effect like the Unreal Bloom, SMAA and Tonemapping provided in the examples but it seems to break the transparency from my render. If I deactivate the bloom pass I get a correct transparent background but when activated, I obtain a black background. I lo…

Failed to mount component: using vue-c3

I tried using https://www.npmjs.com/package/vue-c3 for rendering my c3 charts in vue. It worked some time ago, but now it started giving (in VueC3): “vue.runtime.esm.js?ff9b:587 [Vue warn]: Failed to mount component: template or render function not defined.” even when using a code from a tutorial:…