AleMal
AleMal

Reputation: 2087

Javascript check if an external website prevent iframe

In my javascript i have this code for load an external website into an iframe:

var objSf = createElement("IFRAME", 'objSf', 'objSfcss'); 
    objSf.setAttribute("src", 'http://'+oStxt.value );
    divLogin.appendChild(objSf);

It works for mayor website, but in some cases websites like ex www.asus.it don't load into my iframe but open full browser site. is there any way to know if the website that I'm in my iframe to load is written to avoid iframes, so i do not load it?

Thanks in advance

Upvotes: 0

Views: 368

Answers (1)

Akaryatrh
Akaryatrh

Reputation: 531

As adeneo said, you can always prevent your iframe from being busted.

But on the other side, there's always a way for the url owner to prevent you from showing its content, as explained well here : Frame Buster Buster ... buster code needed

(linked post provides anti-busting code)

Upvotes: 1

Related Questions