I want to load an external html page in an specific table, is it possible with java?

Posted on 2009-02-21
Last Modified: 2012-05-06

I have my home design in a single frame and I want to keep it like that by using a Java alternative. I need to load different html external pages from the main menu of my homepage into an specific table.

Is there a way to do this with Java? Of course I want to keep my page browser friendly too.

Question by:Metacomet
    LVL 5

    Expert Comment

    You could achieve this effect with AJAX, which is in fact (asynchronous) JavaScript.
    I wrote an article about this here:

    It will only load new contents on the specified object, without reloading the whole page. It is like using frames, but without them.

    Hope this helps
    LVL 5

    Expert Comment

    I quickly made a small demo page for you to see how it works like.

    There is a index.html and three other pages (page_one.html, page_two.html, page_three.html) and imports those last ones to a specific div of index.html depending on what link in the navigation menu is clicked.
    LVL 5

    Expert Comment

    Note: I notice you mention with Java, but my answer above relates to Javascript because you posted it in the JavaScript zone.

           Zone:              JavaScript          

    Author Comment

    Wow, this is definitely what I want, now, let me ask you something... Will this work better than and Iframe? Cause I still don't figure how to load different content in the same table as you this in your sample, what I really want to avoid with this function is let the page load as fast as it can.

    LVL 2

    Expert Comment

    i hate to tell you this, but you've got contradicting requests. you want it SEO friendly, but you want to load it with javascript. these are mutually exclusive.

    that said it sounds to me like the best low tech solution is an iframe

    so if you define an iframe in your layout... called "myIFrame" in your navigation you could put


    that should load the new page content without reloading the entire page.

    Author Comment

    VoxEcho: I'm already testing with Iframe function, can I use your piece of code for multiple external html to load in the same table? Eg;


    In the left hand I have a xtml menu and I want to use it to load various html contents in the same table of my main page.

    How would you resolve this?


    Author Comment

    VoxEcho: Sorry, the last comment was for you.
    LVL 2

    Accepted Solution

    sure -

    All you have to do is assign the desired url to the onclick method i mentioned before. you would end up with something like the following:
    <iFrame id="output" width="500" height="500" src=""></iFrame>
    reloadIFrame = function(url){
    var iframe = document.getElementById("output");
    iframe.src = url;
    <a href="javascript:;" onclick = "reloadIFrame('url1.html');return(false);">One</a>
    <a href="javascript:;" onclick = "reloadIFrame('url2.html');return(false);">Two</a>
    <a href="javascript:;" onclick = "reloadIFrame('url3.html');return(false);">Three</a>
    <a href="javascript:;" onclick = "reloadIFrame('url4.html');return(false);">Four</a>

    Open in new window

    LVL 75

    Expert Comment

    by:Michel Plungjan
    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    Article by: DanRollins
    This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (, we'll extend the program by adding a depth-…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now