| Author |
how to load HTML in DIV
|
accnit Jai
Ranch Hand
Joined: Feb 15, 2011
Posts: 33
|
|
I have one JSP page with two DIVs , one DIV to display the content and other to work as menu. In content DIV, I want to load the external HTML page. and I need to call some Java script function of content HTML (loaded in content DIV) to perform some function. When i am using :
document.getElementById("content").innerHTML =xmlhttp.responseText
innerHTML does not return the HTML page.
Can someone please let me know how I can load external HTML in my content DIV and also i can access their Java script function.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
An HTML Page? As in, complete with the <html> tag and everything? If so, then you cannot. It is not valid to include an <html> element anywhere inside the DOM.
If you meant an HTML fragment, that's different.
Which do you mean?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
accnit Jai
Ranch Hand
Joined: Feb 15, 2011
Posts: 33
|
|
|
DIV content will have the linked to Javascript , CSS files and images.. no HTML tag.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
The just an HTML fragment, not a "page" (for that, you'd have to use an iframe).
So now you need to explain how you are "loading" the fragment and what you mean by "innerHTML does not return the HTML page".
And, this doesn't seem like a JSP problem at all, so I've moved this to the HTML forum.
|
 |
 |
|
|
subject: how to load HTML in DIV
|
|
|