3

I want to show an English wikipedia article on the left side of the page and then show the Spanish version of that wikipedia article on the right side of the page.

Is there a way to do that with html, javascript, ajax, etc.?

I know I could use iframes, but it would be nice to have them scroll together (you scroll one, and the other scrolls... or just have one scroll bar for both) and follow links together (if a link is clicked on one page, the appropriate translated page goes in the other side(if it exists)).

Matt Hulse
  • 5,496
  • 4
  • 29
  • 37

2 Answers2

0

An interesting concept. IF you are sure you want to load two webpages then iframe is your option. However, for the functionality that you desire, you have to use a custom scroll on one of the pages and traverse the second page by the same amount. Here is a sample for a single page custom scroll. Just use the same concept for the other page too.

Update : You can perhaps, have a look at this. The content stored in the databases can be access MediaWiki as far as i know. Use this to get the data specific to your link.

Ashwin Krishnamurthy
  • 3,750
  • 3
  • 27
  • 49
  • wikipedia articles often link to other wikipedia articles. so if i click on one of the links in one iframe, it'll load the new wikipedia article in that iframe, but the other iframe will still be on the old article. if a translation for the new article exists, i want it to be loaded into the other iframe as well. does that make sense? – user1030342 Nov 17 '11 at 06:11
  • As @Carles mentioned, there are no workarounds. However, check out the MediaWiki in my updated answer. – Ashwin Krishnamurthy Nov 17 '11 at 08:31
0

Iframes are good to display pages from another domain and let users browse them within your page. However, there really isn't a way to detect click events within the content of an iframe if it is from another domain. This article explains why.

You basically have to find what page the iframe loaded, right? Even if you were to add an onload event on the iframe to check what page was loaded, even this is not allowed, I'm afraid.

Community
  • 1
  • 1
Challe
  • 866
  • 12
  • 26