0

I was trying to detect if a browser supports innerHeight...

Is there any tag to check browser support for a specific code of JavaScript like that of @supports in CSS?

2 Answers 2

2

InnerHeight has a 95.22% all-time browser support rating. Pretty sure you're safe using it. :)

https://caniuse.com/#feat=mdn-api_window_innerheight

Sign up to request clarification or add additional context in comments.

Comments

0

You can use what you're trying to use in an "if" statement

if(window.innerHeight) 
    console.log("window.innerHeight supported"); 
else 
    console.log("window.innerHeight not supported");
div=document.getElementsByTagName("div")[0];
if(div.innerHeight) 
    console.log("div.innerHeight supported"); 
else 
    console.log("div.innerHeight not supported");

2 Comments

They want to check the support of a Window Interface's property, not of a CSS feature.
OH... i've misunderstood the question... Will modify it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.