2

I have a iframe tag in mainpage.html, that iframe calls back.html..

is there any way to call only the specific ids in back.html for display in iframe..

Detail: I have 25x25 table in back.html. initially iframe shows all 625 cells minimised. each cell has a unique id. can i call a specific cell only to display(original size) inside iframe.

or is there any other way to go around it.. please specify

Reporter
  • 3,897
  • 5
  • 33
  • 47
Vivek
  • 21
  • 1
  • 2

1 Answers1

4

Try this code:

var iframe    = document.getElementById('your-iframe-ID'), 
                /* or other kind of reference to the iframe DOM node */

    iframeDoc = ((!!iframe['contentDocument']) 
              ? iframe.contentDocument 
              : iframe.contentWindow.document),

    cell      = iframeDoc.getElementById('your-cell-ID');
                /* this is a reference to cell inside the iframe */

Of course I assume that mainpage.html and back.html are in the same domain (for the same-origin policy)

Fabrizio Calderan
  • 120,726
  • 26
  • 164
  • 177