473,625 Members | 3,353 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2134

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_Spac e_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
3918
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 popular browsers support it (mostly mozilla & the much hated IE, google says the do but nothing is better that experienced answer) - iFrames replaces the old frames once used in html to show a number of pages in a single windows, right ? - what are...
0
2084
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 IFRAMES and 2 IMGs tags. The problem is that the second IFRAME from the second page generates fires a new session.
7
3680
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 that no matter which i use, i can access the src before and after i change it, but the page never displays. in IE6 it works no matter how i access it. here is the code that is changing it: function InternalNav(sPage) {
3
2675
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 relate to the information inside the iframe. Ive managed to put 'back' and 'forward' buttons on each of the iframe's by using:
7
1599
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 down my page or not. Opinions? I know this is not an IDEAL way to store data but I'm at my whitts end and it sounds like a nice workaround right about now!
5
2226
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 is approach.. I'm having some problems and would appreciate some help.. thank you very much... var selItem; var ifrCurr; var div = document.getElementById("divPricing"); // this var not being read inside functions..
2
2088
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 have they been deprecated and will no longer be supported in the future? Please note that I'm *not* asking for opinions on the merits of using IFrames or IFrames vs regular framesets or any other such...
19
5925
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 the page but I find that the iframes interfere with the getting the mouse coords from the screen which is essential in moving the scroll bar around. My test html is given below. With the iframe hidden the mouse coords are obtainable. With the...
2
12766
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 all of them - from the server (this could be on page refresh also) as the purpose is to reset the iframe to the original content in case the user clicked on a link in that iframe and changed it, but also in case there were updates to the original page...
0
8256
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1500
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.