473,808 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Browser Detection - Mozilla 1.3+ & IE 5.5+

Hello,

htmlArea3 is a great script for those who want a free javascript WYSIWYG
editor. The only problem is that it only works in Mozilla 1.3+ & IE 5.5+.

I'd like to find some piece of javascript to not invoke the WYSYWYG if a
browser that supports it isn't being used. To do that I need to know some
very specific stuff about the browser, and the different browsers haven't
made this very easy.

The best I could come up with thus far is posted to their forum here:
http://www.interactivetools.com/ifor...r_Moz__P16141/

But there must be an easier way to do this.

If someone has any suggestions of a script which would allow me to envoke
the script only if a viable browser was being used I'd appreciate seeing
it.

Mike
Jul 20 '05 #1
5 3861
In article <pa************ *************** *@openconcept.c a>,
mi**@openconcep t.ca enlightened us with...

If someone has any suggestions of a script which would allow me to envoke
the script only if a viable browser was being used I'd appreciate seeing
it.

What objects does it use that only IE5.5 and Mozilla 1.3 have? Test for
those.

For example, if it uses document.getEle mentById, test for that.

if (document.getEl ementById)
{
// invoke
}
else
{
alert("you aren't using the right browser.");
}

Best way to not get into trouble with browser detection is to detect for
objects you use.

-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #2
Hi Kaeli,

That's a good suggestion.. I just have to find out what those
objects might be.

Mike

On Fri, 17 Oct 2003 07:33:04 +0000, kaeli wrote
What objects does it use that only IE5.5 and Mozilla 1.3 have? Test for
those.

For example, if it uses document.getEle mentById, test for that.
if (document.getEl ementById)
{
// invoke
}
else
{
alert("you aren't using the right browser.");
}

Jul 20 '05 #3


Mike Gifford wrote:
Hello,

htmlArea3 is a great script for those who want a free javascript WYSIWYG
editor. The only problem is that it only works in Mozilla 1.3+ & IE 5.5+.

I'd like to find some piece of javascript to not invoke the WYSYWYG if a
browser that supports it isn't being used. To do that I need to know some
very specific stuff about the browser, and the different browsers haven't
made this very easy.

The best I could come up with thus far is posted to their forum here:
http://www.interactivetools.com/ifor...r_Moz__P16141/

But there must be an easier way to do this.

If someone has any suggestions of a script which would allow me to envoke
the script only if a viable browser was being used I'd appreciate seeing
it.


All that editing makes use of
document.execCo mmand
so you can check for that, and I think if you call
document.execCo mmand('command' )
on a command that is not supported then the return value indicates that
respectively there is also
document.queryC ommandEnabled
to check support

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #4
Thanks Mark,

On Fri, 17 Oct 2003 16:04:13 +0200, Martin Honnen wrote:
All that editing makes use of
document.execCo mmand
so you can check for that, and I think if you call
document.execCo mmand('command' )
on a command that is not supported then the return value indicates that
respectively there is also
document.queryC ommandEnabled
to check support


Someone suggested the following, which worked fine for both IE & Mozilla:
if((document.al l && document.design Mode) || (document.desig nMode)) {
// Should work fine with htmlArea
}

May come back to execCommand if we run into any problems.

Mike
Jul 20 '05 #5
Mike Gifford wrote:
Thanks Mark, ^^^^ On Fri, 17 Oct 2003 16:04:13 +0200, Martin Honnen wrote: ^^^^^^
Hm?
All that editing makes use of
document.execCo mmand
so you can check for that, [...]


Someone suggested the following, which worked fine for both IE & Mozilla:
if((document.al l && document.design Mode) || (document.desig nMode)) {
// Should work fine with htmlArea
}


if (document.desig nMode)
{
...
}

is equal and there is no point in paranthesing atoms.
May come back to execCommand if we run into any problems.


You should always check for exactly the objects and properties you
want to access. Anything else is not only bad style but will also
most certainly create script errors. The proper way is:

if (document.execC ommand)
{
... document.execCo mmand(...) ...
}

See http://pointedears.de.vu/scripts/test/whatami pp. for details.
PointedEars

Jul 20 '05 #6

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

Similar topics

4
1568
by: delerious | last post by:
I want to know the height of the viewable portion of a page (minus scrollbar) in Opera and Mozilla. For Opera, I could use document.body.clientHeight. Unfortunately, this won't work in Mozilla because Mozilla also subtracts the sizes of the top and bottom margins. For Mozilla, I could use document.documentElement.clientHeight. Unfortunately, this won't work in Opera because Opera returns the height of the entire page, not just the...
16
2880
by: Java script Dude | last post by:
To all Mozilla JS Guru's (IE dudes welcome), I have spent the last three years developing complex DHTML applications that must work in IE 5.5sp2+ but I use Mozilla 1.3+** to do all my development. I have build some cross browser debuggers so my users can send me verbose debug dumps. I have some success but have come to a roadblock with the basic underlying JavaScript models. The only way to get a complete stack in IE is to use the...
12
10182
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical scrollbar, you get the height of the entire document, screwing up any chance of centering a window in the browser using these values. Is there a way to get the height of the actual browser window and not the entire page height? Thanks.
17
2580
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this with a link to old information that suggests use of "navigator": http://developer.irt.org/script/43.htm
4
2583
by: trpost | last post by:
I am looking for a script using javascript to pull browser information including, browser type and version, OS info, plugins (flash, acrobat, media player, etc), java version, etc. that will work on IE/Firefox. I am looking for detalis similar to what is available at: http://www.webreference.com/tools/browser/_browserhawk.html Thanks!
15
2334
by: CMM | last post by:
So I'm half way through overseeing a large project in ASP.NET 2.0. My superiors have decided that it would be nice if we ensured the site worked on all the major platforms (as they see it: IE, FireFox, and Safari). We've made heavy usage of the new MENU control and other intrinsic 2.0 controls.... nothing fancy! just using ASP.NET's built-in controls and very nice, pervasive, and clean usage of CSS. Now I find after more testing that the...
16
2364
by: petermichaux | last post by:
Hi, Does anyone have a a cross-browser setOpacity function that does not use browser sniffing? I looked at the Yahoo! UI function and it detects IE by looking for window.ActiveXObject. I also looked at Scriptaculous and it uses navigator.userAgent. Thanks, Peter
22
2313
by: petermichaux | last post by:
Hi, I would like to display a message to Internet Explorer clients to encorage them to get Firefox. Yes they may like Internet Explorer but it is my site :) http://www.explorerdestroyer.com/ uses navigator.userAgent If ((ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) &&
10
3268
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations where you could improve the application by detecting the browser vendor/version. Some of the posters here disagreed. Since then, I've had to deal with a few of these cases; some of them could be rewritten to use object detection, and some couldn't....
0
9721
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
9600
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
10631
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10374
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...
0
9196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
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
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3011
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.