is there any alternative to < object > tag in google chrome?
<div id="topBar">
<a href ="#" onclick="load_home()"> HOME </a>
</div>
<div id ="content"></div>
Javascript:
function load_home(){
document.getElementById("content").innerHTML='<object type="type/html" data="home.html" ></object>';
}
it works fine on firefox but not in google chorme. why? any solution? it shows "no plug-in available to display this content". now my question is how to available plug-in to display the html page?
is there any alternative to < object > tag in google chrome?
<div id="topBar">
<a href ="#" onclick="load_home()"> HOME </a>
</div>
<div id ="content"></div>
Javascript:
function load_home(){
document.getElementById("content").innerHTML='<object type="type/html" data="home.html" ></object>';
}
it works fine on firefox but not in google chorme. why? any solution? it shows "no plug-in available to display this content". now my question is how to available plug-in to display the html page?
Share Improve this question edited Jul 14, 2013 at 7:50 Giliweed asked Jul 14, 2013 at 6:53 GiliweedGiliweed 5,1778 gold badges30 silver badges35 bronze badges 3-
2
This is what
<iframe>
elements are for. – Blender Commented Jul 14, 2013 at 6:54 -
3
You've got
type="type/html"
That should betype="text/html"
Then it will work fine in Chrome. – Alohci Commented Jul 14, 2013 at 10:06 - wow! thanks thanks thanks! you are right! it wooooorkkksssss :). this code drove me crazy all day. I was dying to find the solution. Thank you so much. Such a silly mistake I hardly noticed! Now finally I can finish my project work. :) @Alohci – Giliweed Commented Jul 14, 2013 at 18:52
1 Answer
Reset to default 5Use an iframe
instead of the <object>
tag. <object>
tags do not reliably work cross-browser, and are mostly used for Flash and sometimes Java applets. See here for more on iframes
.