0

I see this site and many others answering similar questions, but often in ways I fail to understand or just do not make sense. And often in contradictory ways (maybe the spec keeps changing?). And I see posts about how to set up cross domain JavaScript communication, but I do not need to communicate with this external content (and I am still not sure if you must have access to the code-base of both child and parent or not, for these hacks to work).

I need to show another person's webpage, on another domain, in a box on my page. SO basically this is like clicking a link, but instead of specifying that the browser should open this in a new tab or a new window, I want the browser to open it in a in-line frame type deal on the current page. So even I know enough about security to know that there are no security/communications issues with this feature.

But assuming that the browser developers have removed this completely reasonable feature, how do I go about doing this? I have heard talk about some Json data type thing being allowed, but still have not figured out exactly what that means. Can I contact any random external page and get some json summery of the page, or how does this work? (I saw an example with Wikipedia, but I was not sure exactly what was being returned, and if any random URL would work just as well).

I can use PHP for this, but that is just stupid. I would basically just be setting up a proxy to access content I am randomly banned from because of the programming language I am trying to access it from.

Jonathon
  • 2,571
  • 5
  • 28
  • 49

1 Answers1

1

You are looking for iFrames. Note, however, that there are many security restrictions due to potential cross-site scripting vulnerabilities through improper implementation.

You can change the source of that internal frame by simply editing the source attribute of that iframe

Sudipta Chatterjee
  • 4,592
  • 1
  • 27
  • 30
  • I have tried them. Put http://www.google.com instead of /otherpage.com and it just never loads – Jonathon Aug 23 '13 at 02:34
  • Yes, because of security restrictions. Follow the example at w3schools. – Sudipta Chatterjee Aug 23 '13 at 02:35
  • OK, but there example is nothing special. The only reason it works is because it points to the same domain. Change that to stackoverflow of Google and the frame never loads. So iFrames do not work for external URLs? – Jonathon Aug 23 '13 at 02:41
  • Oh wait. It does work for remote URLS. it is just that all the ones I was trying it on were not working. Google and stackoverflow seem to have disabled iframing somehow. – Jonathon Aug 23 '13 at 02:43
  • http://stackoverflow.com/questions/8700636/how-to-show-google-com-in-an-iframe - yes because they set a specific header. Look at that answer – Sudipta Chatterjee Aug 23 '13 at 02:44