Horje
What is alternative of Iframe

Here I show alternative of Iframe


Method-1: Alternative of Iframe (<object>)

Here you can use <object> tag. Follow the example.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<object width="100%" height="500px" data="https://horje.com/learn/565/how-to-set-html-object-element"></object>
 
</body>
</html>

Output should be:

Method-1: Alternative of Iframe (<object>)

Method-2: Alternative of Iframe in HTML 5 (<embed>)

Here you can use <embed> tag. Follow the example.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<embed width="100%" height="500px" src="https://horje.com/learn/565/how-to-set-html-object-element" width="300" height="200">
 
</body>
</html>

Output should be:

Method-2: Alternative of Iframe in HTML 5 (<embed>)

Method-3: Alternative of Iframe (PHP File Contents)

Use PHP File Get Contents

index.php
Example: PHP
<!DOCTYPE html> 
  
<body> 
<?php
$homepage = file_get_contents("https://horje.com/learn/565/how-to-set-html-object-element"); 
echo $homepage; 
?> 
</body> 
</html>

Output should be:

Method-3: Alternative of Iframe (PHP File Contents)

Method-4: Alternative of Iframe (PHP File Contents)

Follow the Example of PHP File Contents

index.php
Example: PHP
<?php
 
// From URL to get webpage contents.
$url = "https://horje.com/learn/565/how-to-set-html-object-element";
 
// Initialize a CURL session.
$ch = curl_init(); 
 
// Return Page contents.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
//grab URL and pass it to the variable.
curl_setopt($ch, CURLOPT_URL, $url);
 
$result = curl_exec($ch);
 
echo $result; 
 
?>

Output should be:

Method-4: Alternative of Iframe (PHP File Contents)

Iframe

An HTML iframe is used to display a web page within a web page.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>HTML Iframes</h2>
<p>You can use the height and width attributes to specify the size of the iframe:</p>

<iframe src="https://horje.com/learn/565/how-to-set-html-object-element" height="200" width="300" title="Iframe Example"></iframe>

</body>
</html>

Output should be:

Iframe





Related Articles
What is alternative of Iframe HTML Link Tutorial
How to point Mouse on HTML Text HTML Link Tutorial
How to make a link text short with screen fit HTML Link Tutorial

Single Articles
Method-1: Alternative of Iframe (<object>)HTML Link Tutorial
Method-2: Alternative of Iframe in HTML 5 (<embed>)HTML Link Tutorial
Method-3: Alternative of Iframe (PHP File Contents)HTML Link Tutorial
Method-4: Alternative of Iframe (PHP File Contents)HTML Link Tutorial
IframeHTML Link Tutorial

Read Full:
HTML Link Tutorial
Category:
Web Tutorial
Sub Category:
HTML Link Tutorial
Uploaded by:
Admin
Views:
79


Reffered: https://www.w3schools.com/html/html_object.asp