Reputation: 171236
How can I embed a Flash SWF file into an HTML page without using JavaScript libraries?
The Flash movie is an advertisement which will run on sites that don't have any JavaScript libraries available (like SWFObject). My only capability is to render a piece of HTML using document.write
. I do not wish to add any external script tags (or write
them for that matter).
The browser requirements are basically "all browsers":
I do not care about validation. The only goal is to make it work reliably.
Upvotes: 0
Views: 7246
Reputation: 92
<object width="400" height="400" data="helloworld.swf"></object>
This will work on all browser, although I will suggest you to avoid using <embed>
tag, as Firefox doesn't support that.
You can learn more about <object>
tag from link below.
http://www.w3schools.com/tags/tag_object.asp
Upvotes: 0
Reputation: 8244
I think it works quite reliably with an <iframe>
.
<iframe src="myclip.swf" width="300" height="200" border="0" />
http://jsfiddle.net/ZZ5Pk/ (Warning: Loud SWF)
Upvotes: 0
Reputation: 17673
use <object> <object/>
& The OBJECT
tag is used by Internet Explorer on Windows,EMBED
is used by Netscape Navigator (Macintosh and Windows) and Internet Explorer (Macintosh) tag like this:
<object type="application/x-shockwave-flash" data="myclip.swf">
<param name="movie" value="myclip.swf" />
<param name="quality" value="high" />
<!-- Sandwich the embed tag inside the object tag -->
<embed src="myclip.swf" quality="high" />
</object>
Upvotes: 2