Clickjacking occurs when a malicious site embeds your site in an invisible frame to trick users into clicking something harmful. To prevent this, you can use X-Frame-Options or Content Security Policy (CSP).
In JavaScript, you can detect if your site is being framed:

- This checks if your page is inside a frame.
- If it is, it breaks out of the frame to protect the user.
It’s a simple method to defend against clickjacking.