javascript and iframe not supported in browsers ot

2019-09-20 02:42发布

问题:

I run a simple html file with an iframe and javascript working fine in IE Browser, but it is not working in other browsers like safari,firefox.

In safari the Iframe box is only displayed, but the content in that is not shown.

Please clarify why safari doesn't support it? what are the alternatives for iframe?

回答1:

You can use <embed> tag ,which behaves like iframe

Here is example

<!doctype html >
<html >
<head>
<title>embed  Tag </title>
</head>
<body>
<p><b>Example of embed tag in HTML5.</b></p>
<embed src="http://www.w3schools.com" height="300" width="300" />
</body>
</html>

While you can also use iframes on all browser

Here is example

<!DOCTYPE html>
<html>
<body>

<iframe src="http://www.w3schools.com">
  <p>Your browser does not support iframes.</p>
</iframe>

</body>
</html>

Are you trying to do any different for iframe ?