• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Showing HTML from another page

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Men call me Jim. Women look past me to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic