How to check connection status of websocket?

In web application development, you’d face a moment that need to check websocket connection status.For example, you’d have a situation that your web backend needs to check if users are active in the browser. It’s as very simple as you just need to check websocket property WebSocket.readyState. It has 4 possible values; “CONNECTING”, “OPEN”, “CLOSING”, “CLOSE”. …

Introduction of Hammer.js

Hammer is a open-source library that can recognize gestures made by touch, mouse and pointerEvents. It doesn’t have any dependencies, and it’s small, only 7.34 kB minified + gzipped! Minified code (v2.0.8) Uncompressed code (v2.0.8) Changelog Browse the source on GitHub What’s new in 2.0?It’s completely rewritten, with reusable gesture recognizers, and improved support for the …

Ngrok for webhook testing.

When you develop your web applications, you will have situation to test 3rd party API integration in the local development environment. The tricky problem here is most of 3rd party APIs are callback based. In a word, most of 3rd party APIs send data/status as callbacks/webhook to original client. However when you wants to test …

Sorting images automatically in HTML, and implement the gallery module

In real website coding, we are facing some challenges to create the complex gallery module in HTML or on the WordPress landing page sites. Fortunately, there are already pre-built libraries we can use or refer on, so we don’t need to waste our time to re-build them from scratch. Here are some of the image …