Posts in November 2023

[PHP] How to Generate Dynamic Table of Contents

table of contents

In this article, we will describe about how to automatically generate Table of Contents from headings using PHP.Our method also supports multiple levels of headings. Goal of this article We aim to automatically generate a table of contents from headings using PHP, assuming the presence of HTML as below.The table of contents will be inserted just before […]

[Javascript] How to Make a Table of Contents Automatically

table of contents

In this article, we will describe about how to automatically generate a Table of Contents (toc) from headings using Javascript.Our method also supports multiple levels of headings. Table of Contents from Headings We aim to automatically generate a table of contents from headings, assuming the presence of HTML as below. The table of contents will […]

[Javascript]How to convert HTML string into Node

In this article, we will discuss how to convert HTML string into Nodes. Converting HTML string to Node This can be very simple, and you can define the function in just one line. The following information is supplementary. DOM operations on the converted Node The Node converted using the previous method is formally known as […]

[Javascript]How to detect if the Event is triggered by user’s action

In this article, we will discuss about how to detect whether an event is triggered by actual user’s actions or forced triggering by a script. In the case of plain Javascript By referencing the isTrusted property of the event object passed to the event listener’s callback, you can determine whether the event was triggered by […]