Code
dump
♻ Codump - Dumped codes ♻

♻ Scripts and snippets of code dumped to recycle over and over again. ♻

I wanted to share my codes with you all and the generations that come. Try and have fun with it! It gives me joy that I could help you create something. I'm happy you're one of the makers group. Trying to build codes and making a better world! ✌️😎

Using JSON to save and display your posts on GitHub pages

When using GitHub pages, you can’t use a PHP back-end to handle and store your posts. Therefore I made this script that uses a JSON file to store the data of my posts. And then displays it on the Codump GitHub page you are looking at right now. Yes, this post is also stored in a JSON file and processed by JavaScript to display it to you. (not true anymore, using jekyll now, yet it stays a handy script)

On click dynamically created elements

When an element is dynamically created in the document/website the normal $('.addedElement').click(function(e){ / click function doesn’t work. The snippet below will solve that issue for u. When clicked on any element, dynamically added or not, with the class addedElement will run the function.

1
2
3
$(document).on('click', '.addedElement', function(){
	alert('Clicked on dynamic added element'); // Change to function you want.
});

Codump | Cheers and enjoy recycling codes!
© 2022 -