473,749 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Want to create a wrapper for code that detects presence of IE or Netscape

Hello - I have this DHTML calendar that displays about 10 pixels off
its target in Netscape 7.0 -- from the script layer I have the block
of code identified that positions the calender on the screen. I was
thinking if I could write a wrapper around this that would execute two
different versions depending on which browser is coming in... for now
I am only interested in all versions of IE and NS 7.0 (haven't tested
it on earlier versions of NS, but would like to understand the flag
adjustments). Thanks for anyone's help!! :)
Jul 20 '05 #1
3 1391
In article <19************ **************@ posting.google. com>,
ma******@yahoo. com enlightened us with...
Hello - I have this DHTML calendar that displays about 10 pixels off
its target in Netscape 7.0 -- from the script layer I have the block
of code identified that positions the calender on the screen. I was
thinking if I could write a wrapper around this that would execute two
different versions depending on which browser is coming in... for now
I am only interested in all versions of IE and NS 7.0 (haven't tested
it on earlier versions of NS, but would like to understand the flag
adjustments). Thanks for anyone's help!! :)


I've had similar problems with pixels. I stopped using them.

As a workaround and only if only IE and NN7 are the only browsers, the
following will work. (note: opera supports document.all)

if (document.all)
{
// IE
}
else
{
NN
}

HTH

--
~kaeli~
I do whatever my Rice Krispies tell me to.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2
kaeli <ti******@NOSPA M.comcast.net> writes:
As a workaround and only if only IE and NN7 are the only browsers, the
following will work. (note: opera supports document.all)
Some versions of Opera. Some of them only sometimes. And so several
other browsers too.
if (document.all)
{
// IE


Bad idea. As you say, it works if the *only* browsers they will view
the page are the *currently avilable* versions of IE and Mozilla.

Most other current browsers, and potentially a lot of future browsers,
will fail. So, don't go there, it's bound to come back and bite you in
the posterior.

The best way (IMNSHO[1]) is to
1) Use a doctype that triggers standards mode. That will let IE 6 show
the page according to the CSS 1 standard, instead of being bugwards
compatible with the highly deprected IE 4. In most cases, IE 6 and
Mozilla (and Opera and other standards supporting browsers) will then
show the pages identically.

I would use HTML 4.01 with en URL. Read more:
<URL:http://msdn.microsoft. com/library/en-us/dnie60/html/cssenhancements .asp>
<URL:http://mozilla.org/docs/web-developer/quirks/doctypes.html>
<URL:http://www.opera.com/docs/specs/doctype/>

2) Where the browsers still differ in rendering, make the page so that
it looks correct in Mozilla. Then add the changes needed to make it
look the same in IE, but wrap them in IE's conditional comments:
<!--[if IE]> blah blah fixes IE blah <![end if]-->
To all other browsers, it looks like a comment. To IE 5+, it is treated
as normal content.

<URL:http://msdn.microsoft. com/workshop/author/dhtml/overview/ccomment_ovw.as p>

Normally, those two steps will be enough to fix any problems you might
have with IE.

/L
[1] in my, not so humble, opinion.
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3
In article <d6**********@h otpop.com>, lr*@hotpop.com enlightened us
with...

2) Where the browsers still differ in rendering, make the page so that
it looks correct in Mozilla. Then add the changes needed to make it
look the same in IE, but wrap them in IE's conditional comments:
<!--[if IE]> blah blah fixes IE blah <![end if]-->
To all other browsers, it looks like a comment. To IE 5+, it is treated
as normal content.

<URL:http://msdn.microsoft. com/workshop/author/dhtml/overview/ccomment_ovw.as p>


That is SO cool. :)

Thanks for sharing.

--
--
~kaeli~
If a turtle doesn't have a shell, is he homeless or naked?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #4

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

Similar topics

4
4548
by: Robert Dickow | last post by:
This code works perfectly in IExplorer, but in exactly the same context does not work at all in Netscape 7.x. <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> <!-- if (window.parent.opener.closed) { window.parent.close(); }; // -->
9
3177
by: jab | last post by:
Je veux lier (join) une table qui se trouve dans une database avec une qui se trouve dans une autre database. Les 2 databases sont sur le même serveur en l'occurence DB2/NT 7.2.9. J'ai créé un wrapper avec le control center (j'ai utilisé DRDA) et ensuite j'ai voulu créé le serveur mais avec le wizard, il ne me présente pas mes tables ! J'ai donc essayé en ligne de commande. J'ai essayé la commande suivante: CREATE SERVER TEST TYPE...
1
1487
by: bennett | last post by:
At http://www.brainjammer.com/testing/validator_test.aspx I have a text field where you can enter text, and a button where if you click the button, it sets the value of a label below it, to display the text you entered in a text field. There is also a RequiredFieldValidator for the text field so that you get an error if you leave it blank. As long as I have EnableClientScript set to true for the RequiredFieldValidator, if I leave the...
8
1752
by: Amanda H. | last post by:
Hi guys, I just started switching my site over to tableless css, and I'm using a very lovely, transparent PNG-24 image. I have been trying to figure out if there is any way to replace an image before loading only for certain browsers using either javascript or PHP (I'm using PHP to switch stylesheets and prefer server-side). The problem is IE's handling of PNG-24 files: every other browser has alpha compatibility and displays PNG-24...
3
4328
by: fyi85 | last post by:
I am trying to create a server on the same machine running the same instance. This is v8.1.5 on Windows 2003 Server. The instance is set to FEDERATED=YES The server will be created for database TEST The TEST database will be referenced from database master. There is nobody using the databases and there are no active connections. I log on to the database master from CLP and do
3
5997
by: zgh1970 | last post by:
Hi, All, We have a database on db2 udb aix. The database has federated server to db2 mainframe. Now We have already catalog database of db2/400 on the db2 UDB aix server. I tried to create new federation server for db2as/400. It seam has problem. 1. can the db2 mainframe and db/400 have the same wrapper? Our existing db2 mainframe uses the wrapper with library libdb2drda.a This wrapper is used by db2 mainframe
3
2280
by: bobc | last post by:
Using SQL Server 2000... I wrote a wrapper to call a sub proc (code provided below). The intended varchar value returned in the output parameter of each proc is a string implementation of an array. (The string separates elements by adding a period after each value. e.g. 1. 2. 3. 4. 5. etc., although my simplified example only creates two elements.) My vb.net calling code parses the returned string into individual elements.
13
1822
by: bobc | last post by:
In my stored procedure, I want to parse @ArrayOfDays into @d1 through @d5. @ArrayOfDays is a varchar input parameter containing, for example, "1.7.21.25.60." - five elements. Most active vars: @i - loop counter @char - current char in string @tempVal - contains the current element as it is being built
5
3075
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... I've got a .Net client to a soap service that works for the most part, but there are a couple of things I'd like to improve: 1) the first request to the client wrapper always takes 12-15 seconds even though the web server shows < a half second spent on the request. What takes so much time for the client wrapper to warm up? All subsequent requests, even to the same method, take the half second.
0
8997
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
8833
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
9568
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
8257
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
6801
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
4709
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
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
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
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.