[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

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!
0
Metacomet
Asked:
Metacomet
  • 3
  • 3
  • 2
  • +1
1 Solution
 
striker46Commented:
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
0
 
striker46Commented:
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.
0
 
striker46Commented:
Note: I notice you mention with Java, but my answer above relates to Javascript because you posted it in the JavaScript zone.

       Zone:              JavaScript          
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
MetacometAuthor Commented:
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!
0
 
VoxEchoCommented:
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.
0
 
MetacometAuthor Commented:
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?

0
 
MetacometAuthor Commented:
VoxEcho: Sorry, the last comment was for you.
0
 
VoxEchoCommented:
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>
<script>
reloadIFrame = function(url){
var iframe = document.getElementById("output");
if(iframe){
iframe.src = url;
}
}
</script>
<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

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now