Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
110
rated 0 times [  112] [ 2]  / answers: 1 / hits: 188295  / 8 Years ago, tue, november 29, 2016, 12:00:00

I'm making web page that has to show another domain's web page.



For example, in my web html, there are two <div> tags.



Like :



<html>
<head></head>
<body>
<div>
<p> hello world </p>
</div>
<div>
<!-- other domain's web page comes here -->
</div>
</body>
</html>


To resolve my issue, I should use <iframe>, <embed> or <object> tags, but this causes the cross domain problem. So, I can't use it to show other domain's web page. They doesn't allow me to use it.



So, for example :



<iframe src=http://stackoverflow.com></iframe>


It doesn't work. My web page can't show stackoverflow.com. Because, stackoverflow denies this.



I have searched lots of things with these issues. But they are just ajax or JSONP. It was not iframe.



Are there solutions to resolve my problem?? Or is it impossible to implement this?


More From » jquery

 Answers
5

You need control over the domain you want to embed to remove/amend its CORS policy.

If the domain has explicitly blocked Cross-Origin requests, there's nothing you can do about it.


This is used to avoid anyone hijacking any site you want (you could have a full screen Google in an iframe running with your ads on top on bettergoogle.com, things like that).


This page will give you more insights on Cross-Origin


[#59889] Friday, November 25, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ammonjesseg

Total Points: 170
Total Questions: 110
Total Answers: 98

Location: Benin
Member since Fri, Mar 24, 2023
1 Year ago
;