nou
nou

Reputation: 67

Simple code to bring up multiple iFrames on one page?

It's been a while since I last did coding, I was just wondering how simple I could make this little idea of mine.

Simply put, I'd like to have 4 input text fields on one page, an example of the label and text field is: http://www.url.com/[ASpecificLink] where the [] denotes Text Fields. Upon filling all the text fields and clicking 'Okay', the next page will list iFrames of the link specified, making it a total of 4 iFrames on one page.

My first question is : How simple could I make this idea? off the bat I thought of using PHP, ideally i'd like to access this on an iPad.

My second question is : Would it be possible, for example, to list specific content in the iFrames. For example, in the link I enter, the only content I would like to show is what is contained within the Table elements of the whole page (this would mean the top banner, navbar and other elements would be excluded)

Thank you very much, and looking forward to some other perspectives on this idea. My approach might not be the most efficient way to go about this, and therefore I'd appreciate some out-of-the-box opinions.

Thank you very much

Upvotes: 0

Views: 1256

Answers (1)

personne3000
personne3000

Reputation: 1840

As for the first question : it is very simple to do, but you should'nt use PHP. This can be done very easily with Javascript :

  • Create a new IFrame element
  • Set the "src" property to the content of the text inputs
  • Append it to the page

The browser will load the pages in the iframes by itself.

As for the second question :

  • Load the page using AJAX (Javascript)
  • Get the elements you want from the page with Javascript
  • Append them to an IFrame's ContentWindow property

No code here, since you seem to be only expecting ideas of implementation options :-)

Upvotes: 1

Related Questions