javascript - is there any alternative to < object > tag in google chrome? - Stack Overflow

is there any alternativeto < object > tag in google chrome?<div id="topBar">&l

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 be type="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
Add a ment  | 

1 Answer 1

Reset to default 5

Use 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744803582a4594638.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信