Link to home
Start Free TrialLog in
Avatar of Metacomet
Metacomet

asked on

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

Hi,

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.

Thanks!
Avatar of striker46
striker46
Flag of Germany image

You could achieve this effect with AJAX, which is in fact (asynchronous) JavaScript.
I wrote an article about this here: http://www.aleixcortadellas.com/main/?p=364

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
I quickly made a small demo page for you to see how it works like.
http://aleixcortadellas.com/demos/ajaxnavigation/

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.
Note: I notice you mention with Java, but my answer above relates to Javascript because you posted it in the JavaScript zone.

       Zone:              JavaScript          
Avatar of Metacomet
Metacomet

ASKER

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.

Greettings!
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

onclick="document.getElementById('myIFrame').src='somepage.html';"

that should load the new page content without reloading the entire page.
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;

Button(1)--------------html(1)------------------------Iframe(1)
Button(2)--------------html(2)------------------------Iframe(1)
Button(3)--------------html(3)------------------------Iframe(1)
Button(4)--------------html(4)------------------------Iframe(1)

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?

VoxEcho: Sorry, the last comment was for you.
ASKER CERTIFIED SOLUTION
Avatar of VoxEcho
VoxEcho

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michel Plungjan
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.