Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
55
rated 0 times [  56] [ 1]  / answers: 1 / hits: 67625  / 11 Years ago, thu, november 7, 2013, 12:00:00

Recently i tried to load youtube website in an iframe, but i checked that it's not worked. i used this simple code.



<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<iframe width=1000px height=700px src=http://www.youtube.com ></iframe>
</body>
</html>



  1. i want to know , why my webpage can't load youtube website in
    iframe..


  2. what code i use to load the youtube website in my webpage.


  3. how i use same techniq in my website, so no one can add my website
    in iframe.



More From » jquery

 Answers
3

For modern browser, need to enable X-Frame-Options in Header,
The x-frame-options header can be implement through web server configuration settings.



You can view the X-Frame-Options in Header as like below image,
enter



Reference: https://www.keycdn.com/blog/x-frame-options/



If your browser does not support it, then you will have NO clickjacking defense in place and can use HTTP Header Field X-Frame-Options,



  <meta http-equiv=X-Frame-Options content=deny>


There are three possible values for X-Frame-Options:



DENY -
The page cannot be displayed in a frame, regardless of the site attempting to do so.



SAMEORIGIN -
The page can only be displayed in a frame on the same origin as the page itself.



ALLOW-FROM uri -
The page can only be displayed in a frame on the specified origin.


[#74428] Wednesday, November 6, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jenamackennac

Total Points: 304
Total Questions: 110
Total Answers: 107

Location: Ecuador
Member since Thu, Jun 4, 2020
4 Years ago
jenamackennac questions
Fri, Feb 18, 22, 00:00, 2 Years ago
Wed, Apr 21, 21, 00:00, 3 Years ago
Thu, Apr 1, 21, 00:00, 3 Years ago
Tue, Feb 2, 21, 00:00, 3 Years ago
;