- Take this as an GIFT 🎁: Build a Hyper-Simple Website and Charge $500+
- And this: Launch Your First Downloadable in a Week (Without an Audience)
GET A 50% DISCOUNT—EXCLUSIVELY AVAILABLE HERE! It costs less than your daily coffee.
Fix These Hidden Mistakes Before They Waste More of Your Time
Let’s cut the fluff—most developers (even the smart ones) waste time fighting problems that already have better solutions.
You’re chasing bugs, writing the same code over and over, or patching things with duct tape because you didn’t know there was a cleaner way. So here are 9 sneaky fixes that’ll make your web dev life so much easier—and faster.
Want more under-the-radar gems like these? javascript.0x3d.site is your new best friend. Real tools, real guides, zero fluff.
1. Still Writing document.querySelector
Everywhere? Just Shortcut It!
Stop repeating yourself like a parrot. Create your own selector shorthands:
const $ = (sel) => document.querySelector(sel);
const $$ = (sel) => document.querySelectorAll(sel);
Now $('#app')
works just like jQuery—but you're still using vanilla JavaScript. Fancy.
2. You Don’t Need a Framework for Smooth UI Animations
Native Element.animate()
is criminally underrated:
element.animate([
{ opacity: 0 },
{ opacity: 1 }
], {
duration: 500,
easing: 'ease-in'
});
Smooth animations without CSS classes, external libs, or even jank. 🎯
3. HTML Has a Built-In Dialog Element. Use It!
Instead of hacking together modal windows:
<dialog id="myModal">Hello!</dialog>
document.getElementById('myModal').showModal();
Boom—instant modals, native to HTML. Clean, accessible, no extra libraries.
4. Stop Using Local Storage for Everything
Yes, localStorage is easy. But it’s synchronous and blocks the main thread.
If you're saving larger or complex data:
🧠 Use IndexedDB
(or a wrapper like idb-keyval
)
🔥 Or try caches
API for static data—originally meant for service workers, but usable in client-side logic too.
5. Add “type=module” and Instantly Use import
in the Browser
Don’t want to use Webpack/Vite just to try out modules?
<script type="module">
import { hello } from './utils.js';
hello();
</script>
Yup, this works in the browser. Dev just got way simpler.
- Try this if you're free (also it's promotion)
6. No-BS Toast Notifications with Just CSS + a <template>
You don’t need a whole UI library for toast messages. Try this:
<template id="toast">
<div class="toast">Copied!</div>
</template>
const toast = document.importNode(toastTemplate.content, true);
document.body.appendChild(toast);
setTimeout(() => toast.remove(), 2000);
Add minimal CSS, and you’re good. Reusable and fast.
7. Use rel="noopener"
on External Links or Get Hacked
Opening links like this?
<a href="https://external.com" target="_blank">Open</a>
Add this or risk exposing window.opener
to attackers:
<a href="https://external.com" target="_blank" rel="noopener">Open</a>
Simple fix. Big deal.
8. Automatically Lazy-Load Images Without JavaScript
Just add this:
<img src="cat.jpg" loading="lazy" />
Native lazy loading in modern browsers. Stop writing extra scripts and let HTML do the heavy lifting.
9. Use defer
on <script>
Tags — Always
You probably already know async
, but for scripts that depend on the DOM being ready, always go with:
<script src="main.js" defer></script>
It avoids blocking rendering and keeps execution order consistent. Basically, it’s the “just works” version.
Your Toolkit Just Got Sharper
These aren’t hacks. They’re smarter defaults—the kind of stuff most devs miss because they’re buried in Reddit threads or old blog posts from 2012.
The good news? You’ve got javascript.0x3d.site to keep finding these underused gold nuggets. Tools, articles, trending problems—everything you need to level up without burning out.
Now go ship something cool. 💥
🎁 Download Free Giveaway Products
We love sharing valuable resources with the community! Grab these free cheat sheets and level up your skills today. No strings attached — just pure knowledge! 🚀
- Nmap - Cheat Sheet - For Beginners/Script Kiddies
- Stealth Tracerouting with 0trace – The Ultimate Cheat Sheet!
- File Compression in Terminal with the Ultimate 7‑Zip Cheat Sheet! 🚀
- Stealth Network Sniffing with This Ultimate 'Above' Tool Cheat Sheet!
- Advanced Forensic Format (AFF) Toolkit's Ultimate Cheat Sheet
- The Ultimate Aircrack‑ng Cheat Sheet: Crack Wi-Fi Like a Pro (100% Free!) 🚀🔥
- Hack Any Software with AFL++! 🔥 The Ultimate Fuzzing Cheat Sheet (FREE Download)
- Hack Like a Pro: The Ultimate Altdns Cheat Sheet for Subdomain Discovery! 🚀🔍
- Hackers Don’t Want You to Know This: The Ultimate Amap Cheat Sheet for Network Recon! 🚀
- The Ultimate OWASP Amass Cheat Sheet – Master Recon in Minutes! 🚀
🔗 More Free Giveaway Products Available Here
- We've 15+ Products for FREE, just get it. We'll promise that you'll learn something out of each.
Making extra income by selling websites has never been easier—AI does most of the work for you!
No need to spend hours researching or figuring things out on your own. This step-by-step blueprint gives you everything you need:
- ✔️ A complete guide that walks you through the process
- ✔️ Detailed checklists so you don’t miss a thing
- ✔️ Pre-made ChatGPT prompts to make website creation effortless
It’s all laid out for you—just follow the steps and start earning! 🚀
Available on Gumroad - Instant Download - 50% OFFER 🎉
Top comments (6)
Ok, no.
Here's why.
Using $ for document.querySelector is not "just like jQuery", because you will not have any of the jQuery functions and setting styling or even innerHTML with it will be vanilla JS, not jQuery.
All you're doing is confusing yourself when you expect it to behave like jquery and it sure as heck will not.
ok, this one's ok.... still, i like my CSS in my CSS and just use JS to add/remove classes, for consistency.
the HTML Dialog element sucks, is not styled the same across browsers and you cannot position it... stick with stuff that works. I use 2 CSS classes, 2 elements, one is an overlay, the other a box i put crap in. Add class "on" to open it [animate however you want] and remove class "on" to close it. The end.
4.a. IndexedDB has its uses for applications that need to store a data set locally for use, but most websites/apps do not need this, localStorage is fine.
4.b. Cache API is nice too, to store endpoint request data... however this is only useful if you don't have data that updates in real time. Eg. product pricing, or game scores, or messages from users, etc etc, so not very useful if you already have a good backend caching setup.
If you're using type="module" you should probably be using a framework...
That is one way of doing toasts. I prefer inserting a new element as needed and removing it when done. Versus always having that empty element hanging around in the DOM, but to each their own.
rel="noopener" on all external links is just good practice. You won't "GET HACKED" if you forget it. Your users might, but chances are it's because they already clicked on something somewhere else first... so relax.
loading=lazy is nice in theory... but in practice the browsers aren't super consistent in behavior, so you generally need to see if it works well enough for you or not.
I much prefer a custom data-src attribute that replaces the src when an img element is just about to scroll into view, but again, personal preference.
using "defer" always... hm, not sure on that one. I guess it's fine. I can't say for sure there's ZERO issues with doing this ALWAYS.... i mean, it's javascript... something is bound to break it at some point.
Impressive and very useful tips!
Thanks!!
Good information given
Great! It's on my list!But there is an integrated all in one web programing environment tool that I also recommend.