javascript
jQuery Calendar event-clicks not firing with ftLab fast click
if all else fails you can inspect which events are linked to your elements with visual event: http://www.sprymedia.co.uk/article/visual+event This adds an overlayer to any web page and let you visually inspect the JS code that’s linked to an element (it shows you the piece of code in a pop up). this way you can easily … Read more
Modernizr Causes Content Security Policy (CSP) Violation Errors
I suspect there’s no other solution than to rewrite the parts of Modernizr that use inline code or dynamically evaluated code (which applies to both JS and CSS). The experiences of AngularJS ngCsp might be useful here.
Multiple detached webview instances seen in chrome devices while navigating in hybrid android app
So the way these web inspectors work is that they use the RemoteDebug Protocol. This protocol defines the various messages and commands that are exchanged to let you ‘inspect’ your pages. One instance of the inspector can only connect to one client at a time. So assuming that you are switching to and fro web-views … Read more
How to add text on top of an existing PDF using JavaScript on a website?
https://pdf-lib.js.org/ library supports modification of existing PDF file. const pdfDoc = await PDFDocument.load(…) const pages = pdfDoc.getPages() pages[0].drawText(‘You can modify PDFs too!’) const pdfBytes = await pdfDoc.save()
Changing CSS transform on scroll: jerky movement vs. smooth movement
You are able to get a visual performance boost by implementing will-change on elements. It is supported in recent browsers (excluding edge and no IE). The will-change CSS property hints to browsers how an element is expected to change. Browsers may set up optimizations before an element is actually changed. These kinds of optimizations can … Read more
JS Events: hooking on value change event on text inputs
I can’t find a suitable event for that. Yeah, there isn’t one. There are DOM Mutation Events, but they aren’t supported well cross-browser, and don’t fire for form values anyway as those aren’t reflected in attributes (except in IE due to a bug). In Mozilla only, a JavaScript watch could be set on the value … Read more
Best practice for ReactJS form components
Anything that is going to change goes in State. If you’re looking at loading an existing entity and editing it, you want controlled inputs, and you want to set the values accordingly. I tend to stay away from defaultValue in most cases (outside of dropdowns) This ties back in to your previous question. If you … Read more
How make promise execute synchronously?
There are of course legit reasons to force synchronous execution of a promise in js. The most obvious is when require‘ing a file that needs to initialize using some asynchronous stuff, and optimization is not an overriding concern. Seems like the package synchronized-promise seems like it ought to do the trick. In your case (warning … Read more
Firefox does not seem to be faster using the asm.js profile, yet Chrome is
When you run code in Firefox, you can often see huge drop in speed for asm.js calls, which is most probably caused either by repeated compilation (which is visible in console) or by cost of js-to-asm calls. This hypothesis is further strenghtened by Luke Wagner, implementor of asm.js: one performance fault that we already know … Read more