Click here to Skip to main content
15,936,119 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to find that my browser support IFRAME or not using Jquery . but no any reference found for that

What I have tried:

Keep Iframe in HTML
<div id="someID">Hello world!</div>



$('#iframeID').contents().find('#someID').html();

it give me undefined . but i have question that how can i identified that my browser support IFRAME .

Please help me in that
Thanks in Advance
Posted
Updated 21-May-18 23:11pm
v2
Comments
Richard Deeming 22-May-18 11:12am    
You probably can't find a reference because <iframe> is supported in just about every browser. Even IE6 supports it.

1 solution

Check if iframe is there on the page

JavaScript
if($("#iframeID").length)
{

alert("The element you're testing is present." );
$('#iframeID').contents().find('#someID').html();

}
 
Share this answer
 
Comments
hardy panchal 22-May-18 7:28am    
Itried that .but that i dont want . i need my browser support Iframe or not

Hello world!

above div is require to keep in iframe ?
$("#iframeID").contents().find("#someID").html();
this give me undefined in some browser and give error like
Cannot read property 'contents' of null
in some browser
GKP1992 22-May-18 7:37am    
What do you do when the browser does not have iframe?
hardy panchal 22-May-18 7:33am    
I just only to know that my browser is compatible to Iframe
GKP1992 22-May-18 7:39am    
wouldn't the .length crash if the $("#iframeID") is null?
hardy panchal 22-May-18 8:43am    
I don't want any value of element in Iframe .just want only that my browser support Iframe or not .Thats it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900