<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/1-20.jpg" data-lazy- height="146" src="data:image/svg xml,” width=”580″>
<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/2-20.jpg" data-lazy- height="147" src="data:image/svg xml,” width=”517″>
- Useful for small scripts or scripts which only execute within one file.
- Difficult to read and understand if scripts are larger or used in several pages.
<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/3-20.jpg" data-lazy- height="119" src="data:image/svg xml,” width=”487″>
In the above example, whenever the user loads the web page the script displays an alert message showing the current date.
<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/4-18.jpg" data-lazy- height="165" src="data:image/svg xml,” width=”571″>
let date = new Date();
document.body.innerHTML = “
Date: “ date “
<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/5-17.jpg" data-lazy- height="147" src="data:image/svg xml,” width=”566″>
About the author
<img data-del="avatar" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/10/echo/7011409B3A384F43A8417D1DAC68D179-150×150.jpg6164f8772e10b.jpg" height="112" src="data:image/svg xml,” width=”112″>