473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Load HTML page into another HTML page using Javascript

<html>
<head>
<script type="text/javascript">
function init(){
var html = document.open('Hello.html');
document.getElementById('hi").innerHTML = html;
}
</script>
<body onload ="init();">
<did = 'hi'>
</d>
</body>
</html>

this code is not working Help me load hello.html page into this
index.html page
Jun 27 '08 #1
1 8147
"Duke" <p.**********@gmail.com>
<html>
<head>
<script type="text/javascript">
function init(){
var html = document.open('Hello.html');
document.getElementById('hi").innerHTML = html;
}
</script>
<body onload ="init();">
<did = 'hi'>
</d>
</body>
</html>

this code is not working Help me load hello.html page into this
index.html page
Something wrong with your quotes: document.getElementById('hi") ->
document.getElementById('hi')
Maybe <did = 'hi'should be'<d id = 'hi'>.
And what sort of element is <danyway ? Try <pinstead.
Rather than loading a html file into an element, would it be a better idea
to load the body part?
document.getElementById('hi').innerHTML = html.body.innerHTML;
Testing is easier when you use onclick instead of onload. In FF+Firebug you
should be able then to follow execution.

Tom
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jen_designs | last post by:
Can you load 2 xml files on an html page via javascript? I can get one xml file to load, using the following code. How about two. I need to combine 2 xmls files on the client. Any other way to...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
3
by: Shapper | last post by:
Hello, I am working on an ASP.NET/VB web site. I have several links including menu links. Considerer a want to load a page named page.aspx. I can do it using javascript. Or using this code:...
6
by: sylcheung | last post by:
Hi, How can I be notified when the document load is complet in JavaScript? I am referring to the whold document load is complete, mean all images/external files/frame/iframes have been loaded. ...
3
by: Mike Dee | last post by:
Hi, I'm having an issue with the status bar in Mozilla and Netscape showing that it is still waiting on the page to load even after it is finished. This problem does NOT occur with IE. In...
6
by: acord | last post by:
Hi, In a html page, I don't know how to load in a php page from javascript. I've already defined a <div id="treemenu"> in the html page. The executed content from the php script is supposed...
8
by: Fish44 | last post by:
Ive got a PHP script, which if it ends correctly, i want load another PHP file or an HTML page automatically, ie without user intervention. The new page shoud replace the current page on the...
1
by: jianxin9 | last post by:
Hi, I have an ajax powered tabs box that has a javascript drop-down search menu in the first tab. When I click on another tab, and go back to the first tab I have to refresh the page to get the...
2
by: pankajsingh5k | last post by:
Dear All, Please help me... I had read an article to lazy load a tab in a tabcontainer using an update panel on http://mattberseth.com/blog/2007/07/how_to_lazyload_tabpanels_with.html ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.