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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

5 Comments

I have tried them. Put google.com instead of /otherpage.com and it just never loads
Yes, because of security restrictions. Follow the example at w3schools.
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?
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.
stackoverflow.com/questions/8700636/… - yes because they set a specific header. Look at that answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.