What is an iframe in HTML?
The <iframe> tag specifies an inline frame. An inline frame is used to embed another document within th...
For further actions, you may consider blocking this person and/or reporting abuse
One reason I don't ever use iframes in HTML is because of it's security vulnerabilities!
And it also causes bad user experience
Solution: Use AJAX instead of Iframes!
Just don't use iframes too much ;)
I agree, but this article only improves web page speed, because by using this method we load iframe after clicking on the element.
Thanks for suggestion :)
What about the sandbox mode in iframes?
That works, but still, keep in mind that hackers can "intercept" data in iframes,
Basically hotlinking the site, and tracking keystrokes for example.
A way to prevent this is inserting this in your
.htaccess
fileIt's just a personal feeling or nowadays,front end developers must have some skills in security field? Are best practices enough to guarantee a safe navigation to our user?
Well, technically, yes, but it's a good practice to write secure code, no matter what you are building!
Also, It's also not just front end devs who need to consider security, it's also backend too ;)
But this article is useful if you're embedding a youtube video in an iframe.
Otherwise, I prefer AJAX, since it "embeds" smooth, and clean. It doesn't restrict scrolling.
How can I use AJAX to achieve the same thing of Iframes? 🤔🤔🤔
Check out demo for further clarification
Source code: replit.com/@ManuTheCoder/ajax#inde...
Thank you! ❤️
Although completely different technologies, the iframe tag has always reminded me of something like adobe flash. Never felt pretty confident using it, as well as had a lot of headaches on sizing and responsiveness, etc.
Yes, actually this article for Embed youtube videos, if we have used it directly it increases the page load time,
So we can use this way it can decrease page load time because by using this method we load iframe on click element
yw :)
Ok, in this case, an Iframe would probably be the best option.
Just make sure that only your domain can iframe it ;)
Nice! For YouTube I use this: dev.to/miga/prevent-youtube-iframe... so I don't have to make changes to my HTML code
What are the real benefits, besides the numbers?
no external request which might violate GDRP/DSGVO