I want to load a completely new html page in a html via javascript

<html>

<head>
<script> 
                function load_home(){

                            document.getElementsByTagName("body")[0].innerHTML='<object type="text/html" data="test1.htm" ></object>';

                }
</script>
</head>

<body onClick="load_home();">
</body>

</html>

So what is the problem/error? while i dont understand the purpose, you code seems to work fine, at least with regards to loading the content from test1.htm, yes/no?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.