Include a webpage inside a div

前端 未结 7 719
情歌与酒
情歌与酒 2020-12-09 06:10

I have to include a webpage inside my webpage\'s div. I want somehting like iframe to be done with DIV. Basically, I will be providing a URL to my

7条回答
  •  温柔的废话
    2020-12-09 06:20

    This is really an extension to Saeed's response. To get around cross site scripting issues, you will have to write a script on your own server that does a CURL call for the webpage to be embedded. Your javascript will then make a call to this script, passing the URL as a GET/POST parameter.

    I agree with a lot of other people here that this is a case where you really should just use an iframe... I believe you can set the iframe with no src tag and manually put the content inside it. That would mean you don't need to take the steps Saeed suggested to break up the head and body. However you still need the script I described to get around cross site scripting.

提交回复
热议问题