Search code examples
javascriptreload

Looking for sample code that allows clicking on menu to reload center panel only


I have a page that shares the same footer / header layout and design.

I am looking for sample javascript code that allows clicking on menu to reload center panel only. I am not doing it in JSP. I hope to get some sample javascript code.

Can I put the center panel in an iFrame or another type of widget?

What is the most efficient way to do this?

Thanks a lot.


Solution

  • From this question

    document.getElementById('iframeid').src = document.getElementById('iframeid').src
    

    However, this if your header and footer are in frames, or if your body is in a frame, just to make them resuable, this is a Bad Idea! Your server should be generating a SINGLE PAGE by using a layout page for the header and footer, and rendering the body.