aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Showing HTML from another page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Showing HTML from another page" Watch "Showing HTML from another page" New topic
Author

Showing HTML from another page

Tarik Ansari
Ranch Hand

Joined: Dec 31, 2008
Posts: 50

Hi All,

I have a requirement.. I have three html pages Menu.html, Display1.html and Display2.html.

Menu.html has two links-> Display1 and Diplay2. Onclick of either Diplay1 or Disply2 link it has to open the appropriate html (Display1.html or Display2.html) within the Menu.html. (Embed another html in menu html)

Hint: Get innerhtml from external page.

Please help me.

Thanks
Tarik
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60055
    
  65

In the click hander for the link, use Ajax to fetch the page to insert and stick it into the DOM.

This is a lot of rather advanced JavaScript code, and I get the impression you are not very familiar with JavaScript.

I'd recommend using a library like jQuery or Dojo to help you with the event handling, Ajax, and DOM manipulation. You'll still need to learn some JavaScript, but not as much all at once.

Also bear in the mind that the "sub-pages" should not be full HTML pages, they should be HTML fragments suitable for where you want to load them.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Showing HTML from another page
 
Similar Threads
Synchronized methods
Need solution for a query on JSP
populating an array via the user
html:option tag and default value
servlet call the method from one servlet to another servlet