Press "Enter" to skip to content

A Simple Javascript Tool Library For Switching iframe | alt-iframe

alt-iframe is a simple JavaScript tool library for partial HTML (iframe alternative) without framework or jQuery. The fastest way to embed an external file on the page is to use the <iframe /> element.

The iframe element is used to embed another document within the current HTML document. However, it is not a best practice because iframes can cause SEO, usability, and even security issues in modern web applications.

How to make use of it:

1. Include the alt-iframe library on the web page.

<script src="./dist/es5/alt-iframe.min.js"></script>

2. Use src attribute to load a partial HTML contained in the tag.

<header src="external.html"></header>

3. Use id attribute to load partial HTML on click on.

<main src="external.html" id="containerMain"></main>

4. Use replace attribute to exchange the tag with partial HTML content material.

<div src="external.html" replace></div>

Include HTML From External File, alt-iframe Plugin/Github

Read More  [Browser Mockup] Detect iFrame Embedding in Javascript | mockframe.js

See Demo And Download

Official Website(FrontEndNeo): Click Here

This superior jQuery/javascript plugin is developed by FrontEndNeo. For extra Advanced Usages, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *