Iframe cross-domain

create a new h5 page
< iframe id= "test1" src= " https://www.cnblogs.com/chans.; Width= "height=" 200px > < / iframe >
then write the above line
and then refresh
and then the console will report this error
Refused to display" https://www.cnblogs.com/chans." in a frame because it set"X FrameMutual Options" to "sameorigin".
but I keep refreshing and find that I report an error for a while and not for a while.
according to reason, this mistake should be reported all the time, right?

Mar.25,2021

I've tried that cnblogs's server doesn't always have "X-Frame-Options" in the response header of every request.
you have to ask the developer over there for the exact reason.


allows cross-domain requests, which needs to be supported by both the browser and the server. You should allow cross-domain requests on your web page, but cnblogs does not allow cross-domain requests, so you cannot embed cnblogs in iframe.

Menu