Full-text search in JavaScript (part II)

Some years ago, I wrote a post about how to perform a full-text search in JavaScript modifying the DOM to highlight the results.

The aforementioned post has been outdated and there are better ways to perform a search in JavaScript, without using complex regular expressions, and without rewriting completely the HTML container on each search.

Read More »

3D Geometric plane animation using CSS3

Some days ago, I answered a question on Stack Overflow that asked for emulating a JavaScript Popmotion code using the GreenSock library. The original code animates a geometric plane with a tridimensional effect when it is dragged with the mouse.

Answering that question, the next code resulted, that replicates the same effect using just Vanilla JavaScript Read More »

Fibonacci Sphere using CSS3 transformations

It has been some time since I don’t post anything, the project in which I’m working takes too much time from me. But this doesn’t prevent me to experiment a bit with the things that apasionate me.

I have wanted to test the performance of the main browsers using CSS3 transformations. In this little experiment, in each mouse movement, 300 DOM elements are transformed. Read More »

str_replace PHP function in JavaScript

Working with JavaScript, if one wants to replace a part of a string with another string, usually, the replace String method is used. This method allows to manipulate a string using another string or a regular expression. Next it is shown how it is used: Read More »

Full-text search in JavaScript

There is a newer post with a better method to perform a full-text search in JavaScript.

Some time ago, I needed to create a full-text search in JavaScript in a project that I was working on. The requirement was to search the text directly in the DOM modifying it and highlighting the relevant results.

The majority of the scripts on the internet, explain how to search a text inside a string, but many of them focused on verifying if the text is present or not, using for it the indexOf or the search methods of the String object.

Read More »

str_pad PHP function in JavaScript

Introduction to str_pad

Many times one needs to fill a string with another string using JavaScript. To achieve this, there is a useful function in PHP called str_pad. This function can pad a string to a certain length with another string. In this way, we are able to achieve that a certain data has always the same length, e.g.:
Read More »