473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Detexting if IFRAMEs enabled

Is there a way to use Javascript to detect if a browser supports
IFrames, or (if it DOES support them) that IFrame use is enabled?

Thanks,
Ann

Dec 1 '05 #1
3 2106

Giggle Girl wrote:
Is there a way to use Javascript to detect if a browser supports
IFrames, or (if it DOES support them) that IFrame use is enabled?

Thanks,
Ann


I can't guarantee this universally, but you could try something like:

<iframe src='mypage.htm'>
<script type='text/javascript'>
var ifSupport=false;
</script>
</iframe>

<script type='text/javascript'>
// must be placed below iframe tags or
// called as onload code.

if( typeof ifSupport != 'undefined' )
// iframes supported
else
// alert or redirect etc

</script>

--
S.C.

Dec 2 '05 #2
Stephen Chalmers wrote:
Giggle Girl wrote:
Is there a way to use Javascript to detect if a browser supports
IFrames, or (if it DOES support them) that IFrame use is enabled?
[...]

Signatures are not to be quoted unless explicitly referred to.
<URL:http://jibbering.com/faq/faq_notes/pots1.html>
I can't guarantee this universally, but you could try something like:

<iframe src='mypage.htm'>
<script type='text/javascript'>
var ifSupport=false;
</script>
</iframe>

<script type='text/javascript'>
// must be placed below iframe tags or
// called as onload code.

if( typeof ifSupport != 'undefined' )
// iframes supported
else
// alert or redirect etc

</script>
That is essentially the same as

<iframe src='mypage.htm'>
<script type='text/javascript'>
var ifSupport=false;
// iframes supported
</script>
</iframe>

<script type='text/javascript'>
// iframes not supported
if (typeof ifSupport == 'undefined')
{
// alert or redirect etc
}
</script>

Yet it will still not work without client-side script support.
--
S.C.


Signatures must be delimited with a line containing
(in words, not literally) MinusMinus_Space_Newline.
PointedEars
Dec 2 '05 #3
Giggle Girl wrote:
Is there a way to use Javascript to detect if a browser supports
IFrames, or (if it DOES support them) that IFrame use is enabled?


As Stephen wrote: yes, there is. But not considering that
client-side script support may not be present, why would you
need to?

<iframe src='mypage.htm' ...>
alternative content
</iframe>

works fine. Everywhere, anytime.
PointedEars
Dec 2 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: maxim vexler | last post by:
I'm reading a lot of talks lately about the term iFrame and with your permission would like to ask a few question about that : - what is iFrame, i mean what is it good for ? - does all the...
0
by: Dan Popa | last post by:
Check out the following 2 links: http://www.batisdev.com/admin/test_1images.asp http://www.batisdev.com/admin/test_2images.asp First page contain 4 IFRAMES and 1 IMG tags. Second page contain 4...
7
by: Scott | last post by:
Hello All, I've been reading all of the various issues with Iframes in netscape. I have tried all of the various fixes posted, and have even implemented both an iframe and ilayer. My problem is...
3
by: Nick Tew | last post by:
Hi, Firstly, any help would be gratefully received. Im using several iframes on a single page and would like individual 'back' and 'forward' buttons located in each of the iframes which only...
7
by: bscofield | last post by:
What would be the danger in having a lot of hidden iframes? i.e. potentialy 30-40. I need to store a bunch of data and thought about using hidden iframes to do it but wasn't sure if this would bog...
5
by: Frances | last post by:
I need to replace iframes acc. to what option user chooses in a sel obj.. but figured have to load a blank iframe when pg loads so I can replace it.. (iframe gets put in a pre-existing div..) this...
2
by: Guadala Harry | last post by:
1. Are IFrames supported only in uplevel versions of IE? If not IE exclusively, what browsers support IFrames? 2. Are IFrames going to be supported in the future - as far as anyone knows - or...
19
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up...
2
by: ericisjusteric | last post by:
I have a page with multiple iframes and need to have the user (ie6) be able to click a button to refresh any one of the iframes - but also to click another button at the top of the page to refresh...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.