Tag JavaScript

The new native-lazy load Vue Component

So since April 2020 we have a browser native support to do lazy loading of images which is great, so i decided to write a quick Vue component that uses that functionality.

One problem with the lazy native loading is that it won't display any loading indicator when the image loads.

At the moment only Firefox and Chromium(also Android) based browsers are supporting this feature but it behaves very differently, in Chromium-based browsers it loads far from the end of the viewpoint (a very eager l...

View full article

Puppeteer tricks to write a bot/scrapper

I wrote a bot recently that does some actions after it authenticates with an account using puppeteer and it was incredibly easy.
In case you don't know what puppeteer does, well, it is simply a Node library to control Chromium or Chrome programmatically, now such a library can have many uses but I'll focus on what you need to know when writing a scrapper/bot.

The first thing to know is what kind of website you are dealing with, it is a traditional website or is more like a SPA type of website? A...

View full article

Example of Language System in an Ionic 3 Application

When you want to create a language system and add multiple languages to your Ionic APP you have various designs available, but in a simple APP, there are 2 major ones.

The first design is where the UI design and APP functionality remain the same for both languages, in this case, you can use some javascript objects for every component you have.
This design is suited when you want to have consistency and implies a bit less work.

The second option is to clone each of your components for every langu...

View full article

Fast way to set up a form with PHPMailer and Ajax

PHPMailer is a popular library for sending emails as the project of the title suggests. In GitHub, the readme file has a nice example of a basic setup, but today I'll give you a similar simple example using jQuery, Swal( Sweet alert ).

So first this is the PHP script that should respond to an ajax request (for example a file named smail.php):

<?php error_reporting(0); // Import PHPMailer classes into the global namespace // These must be at the top of your script, not inside a function use PHPM...
View full article