473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

access innerHTML of external document

2
I'm trying to load content into an iframe by clicking on a link. Specifically, I have many tables all loaded into one HTML document, and I need to load each individual table based on the link that is clicked (ie. clicking the "money" link will load the "money table"). I've already loaded the file into the iframe document with "src". My approach right now is loading an iframe with the content and then dynamically writing inside the iframe itself. The code I'm writing in the iframe is the innerHTML of external document with all the tables (innerHTML of the specific table). However, I'm having a little trouble accessing the external document; this is what I have so far:

Expand|Select|Wrap|Line Numbers
  1. function displayTable(tableId)
  2.     {
  3.     var id=document.getElementById(tableId);
  4. //i found this somewhere on the internet - I'm not exactly sure if this is correct
  5.     var ifrm=(id.contentWindow)?id.contentWindow:(id.contentDocument.document)?id.contentDocument.document:id.contentDocument;
  6.     if (id.style.visibility="hidden")
  7.         {
  8.         id.style.visibility="visible";
  9.         id.style.height="600px";
  10.         ifrm.document.open();
  11.         ifrm.innerHTML = ifrm.document.anchors(ifrm.document.getElementById(tableId)).innerHTML;
  12.         ifrm.close();
  13.     }
  14.  
Any help appreciated! I just learned Javascript yesterday, so any points in the right direction would be great.
Jul 8 '10 #1
1 2207
acoder
16,027 Expert Mod 8TB
Before we look at the problem of accessing the innerHTML, what is the purpose of using an iframe here?
Jul 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Roy Settle | last post by:
Does anyone know how to access a WORD document using ASP? I have a few users that fill in fields in a WORD document and I need to be able to open that document and read these fields once the...
3
by: nLella | last post by:
Hello, Is there any way where, from server side, I can access the innerHTML value of a control (Hyperlink/Label) which is modified at the client side ? I wish to read the changed InnerHtml on...
4
by: Leo | last post by:
Hi, Does anyone know if it's possible to print an external document with vb.NET? I want to create a function that needs a file name (*.doc, *.xls *.pdf or whatever) and then print that...
1
by: Bon | last post by:
Hello all I create a form with three buttons in MS Access 2000. They are Open Excel Template, Save Draft and Save Final. When I click the Open Excel Template button, the Excel template will be...
13
by: Lloyd Dupont | last post by:
In the good old days I believe people were using the arcane technology which came to be known as COM+ to embed other application's document in their own document. Like a Word with document a...
0
by: BillHounslow | last post by:
I hope someone can help me. Currently, I am printing four, multi-page Access Repots to Document Imaging, then manually combining them to form a single document for distribution. Can anyone...
2
ak1dnar
by: ak1dnar | last post by:
Hi, there is requirement to read some external documents from my web application. I'll further explain it like this. I am working on a web application that helps to read the contents of the...
3
by: robboll | last post by:
I am working on a form where one of the checkboxes asks if there is a document associated with the record? If you user clicks to check it (i.e., "Yes"), I would like these events to occur: 1. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.