-
Is there a sure way to detect IE or NS using javascript? I have a site that requires an HTML version along with the Flash site. I already know how to detect the Flash Player but Netscape really messes up my plans for an HTML site (that will need to be done with frames). Is there a way to detect the browser in order to re-direct the viewer to the appropriate site that is customized to that particular browser?
Thanks in advance,
-
good poll choices, steve! [img]/infopop/emoticons/icon_smile.gif[/img]
seriously, yes you can do it. have a look at some of the javascript resources at http://www.hudziak.com/haznet
using macromedia's built-in code probably won't help much, but there are other pieces of code out there that you can use (the javascript tip of the week on browser detection helps)
most people check for certain strings in the browser name and then a certain digit in the browser and then go from there. there are tons of scripts on the net, so you can probably dig up some pretty decent ones without too much trouble. when it comes to javascript, though, i generally have a look at netscape's devshed stuff from way back in the day (again, you can get there from haznet) as a starting point and go from there.
hth,
Deep (just a guy)
<font face="arial" size="2">
Pradeep Kumar Nair, B.Math
Senior Web Designer
http://www.blab.com
ICQ: 39102360
</font>
-
I don't know a lot about javascript but I did manage to write one that seems to work very well with browser detection. Beleive me, it was a trial and error process because the end result was very confusing to me. It appears to detect the opposite browser and send the viewer to the correct browser. I noticed that it kept re-directing me to the opposite browser page so I just switched the hyperlinks. Maybe someone can tell us why this works. I tested it in NS 3.0, 4.6, 4.7 and 6.0. It also works with IE as far as I can tell (5.5 anyway). I am very confused as to why this works.
Here is the code:
<SCRIPT LANGUAGE="JavaScript">
< !--
var isNS=(navigator.appName=='Netscape');
var isIE=(navigator.appName=='MSIE');
if(!(isNS))
{
location.href='ie.htm';
}
else if(!(isIE))
{
location.href='ns.htm';
}
//-->
</SCRIPT>
Why does this work?
Thanks in advance again,
-
Oops.... Sorry for selecting this as a poll. Didn't realize I did. I was wondering why it was asking me for options. Dumb luck I guess.
Thanks,
-
<SCRIPT LANGUAGE="JavaScript">
< !--
//grab some information from the browser
//about itself. the appName is what
//it calls itself
var isNS=(navigator.appName=='Netscape');
var isIE=(navigator.appName=='MSIE');
//check to see if the browser name
//contains "MSIE"
if(isIE)
{
location.href='ie.htm';
}
//check to see if the browser name
//contains "Netscape"
else if(isNS)
{
location.href='ns.htm';
}
//if it's not netscape or ie, then
//send it to some page which is safe
//for ALL browsers
else
{
location.href='textpage.htm';
}
//-->
</SCRIPT>
Well, it's not the most effective script I've seen, but it should server your purposes for now. I've added some comments to make it a bit more clear why it works
<BR>hth,<br>Deep (just a guy)
<font face="arial" size="2">
Pradeep Kumar Nair, B.Math
Senior Web Designer
<a href="http://www.blab.com">http://www.blab.com</a>
ICQ: 39102360
</font>
-
It looks as if you got it backwards. I see that you logically straightned out the code but it doesn't work that way (not to my experience anyway). All the browsers I tested it with send it to the wrong page. That's why it goes to the Netscape page if the browser is detected "MSIE" and goes to the Internet Explorer page if the detected browser is "NS". It seemed to work backwards for some reason and I can't understand that. I tested it on NS 3.0, NS 4.6, NS 4.7, NS 6.0 and IE 5.5. Test it, you'll see what I'm talking about. I'm not a javascript expert by any means so if this is something that I'm "just not getting", please excuse my inexperience and don't get offended that I'm questioning your feedback.
Thanks a million,
-
WebMonkey Scripts has a script that should work for you, regardless of browser, etc. It's well documented, too - hopefully this helps out somewhat.
hth,
Deep (just a guy)
<font face="arial" size="2">
Pradeep Kumar Nair, B.Math
Senior Web Designer
http://www.blab.com
ICQ: 39102360
</font>
-
Hi Deep,
Thanks again for all of your help. I have been using Dreamweaver now for about a month. I got smart and converted from Front Page 2000. Anyway, I happened to notice this afternoon that there is a behavior that can be set with Dreamweaver to do this. Sorry for wasting your time. I was really just curious of why that script worked on the browsers I tested it on when it looks like a mess.
Thanks for all your help in the past and in advance for future questions. Especially since this question wasn't related to Flash. Your dedication is much appreciated.
-
hey no prob! [img]/infopop/emoticons/icon_smile.gif[/img]
incidentally, even though dreamweaver has its behaviors, i'd say that it would be a good idea for you to get used to using javascript and coding it by hand. you're getting to the point where wysiwyg editors are going to be a little bit beneath you soon. you'll start desiring functionality that they can't provide, or that will be easier to do without their nasty way of reformatting all your code. i've kept going to your site from time to time to keep an eye on your progress, and you're getting to the point where i'm sure you're going to want more control than any wysiwyg editor is going to give you.
it's just a suggestion, but you might want to start teaching yourself a few more advanced tricks and techniques by hand. for the next few months or so, dreamweaver should be fine for you, and maybe afterwards you'll move to homesite. but i can see you switching to a combination of a wysiwyg and a text editor (like ultraedit or textpad or something) within the next year and a half, just to keep the most control over your pages. might as well start learning the techniques when you don't HAVE to so that you're not frustrated later on, hm? [img]/infopop/emoticons/icon_biggrin.gif[/img]
good luck with everything!
hth,
Deep (just a guy)
<font face="arial" size="2">
Pradeep Kumar Nair, B.Math
Senior Web Designer
http://www.blab.com
ICQ: 39102360
</font>
-
I also visited your site and cam back her to tell you that I'm really impressed. Efficient, fast loading and effective.
Perhaps a hint, or, sorry, a new dimension to your quest: I prefer to use, and do use the OPERA browser. In my opinion it is the most reliable and the fastest.Even with a cable ISDN connection one sees the difference. For CSS, Opera is the best.
I had no problem visiting your site but I was just wondering if you tried your site in Opera or not...
-
Hey Erik,
How well does the Flash 4 and Flash 5 plugin work in Opera? I want to use it for development purposes (testing and what-not) but I need to test some heavy-duty Flash stuff (mostly Flash 3 and 4 stuff, but some Flash 5, as well). Any clue how well it handles?
Thanks in advance...
hth,
Deep (just a guy)
<font face="arial" size="2">
Pradeep Kumar Nair, B.Math
Senior Web Designer
http://www.blab.com
ICQ: 39102360
</font>
-
Hi.I am not Erik, but I thought my observation might help. I usually test my pages in Opera and I have noticed that if you use Flash elements like banners, buttons or navigation bars embedded in HTML page the Opera browser creates ugly margin at the top of the flash movie. The height of the margin is usually equal to the height of the movie. At first I thought there was some trick in the code to fix it but then I checked other sites and found the same outcome -ugly margins. However I haven't seen anything like that when pages contained .swf only. Also I did not find any problems with Flash plugin in Opera.
Alex
-
NoI have not tested this site on an Opera browser. I am very interested in doing do though. I do not currently have the opera browser installed on my computer. Can you tell me where i can get it?
Thanks for your input and insight,
-
I have jumped into a pool of blood and am struggling (but I will make it). Instead of jumping to Homesite, I am now using Cold Fusion and UltraDev. No real point here, I just thought your last reply was chillingly close.
-
Hi, it's been a long time since I last visited this forum/poll. Sorry to have kept you waiting.
Opera can be downloaded from www.opera.com. The newest version is 5.02 and I always surf with it. I downloaded the Java version which has more MB, but still is much smaller than for example IE.
You have to install the Flash/Shockwave plugin yourself. You do this as follows:
1/You make a copy of opera.exe to another folder, rename it "netscape.exe" (without the brackets of course) and put it back in the opera folder.
2/ You download the install thing from Macromedia and direct it to the opera folder, and then you install. Simple like that.
Opera has more netscape than IE characteristics, but you can make it to be recognised as opera, netscape or IE.
Deep, I tried out www.shockwave.com and one of my favourite flash sites www.rustedfaith.com and also www.robertocavalli.net which both use flash, and I had no problems.
Downloads go quicker than with IE5 and most important: it's free if you accept the publicity in the upper right-hand corner.
Still, not everyone likes it, and a friend of mine, who is far more professional as I, wrote me (quote):
That's the same version I tested. When Opera fails on Javascript it didn't
do anything odd other than it just didn't do what it was supposed to do. A
visitor probably would never know what was supposed to happen unless they
had been there in another browser. I went to an administration page to edit
some information on one of my accounts. It is setup to administrate just
using a regular browser. It has lists where you type in a word and when you
click add, the word is appended to a list below. You can add more items to
the list or you can select items in that list and then click remove to
remove just those selected ones. Then another area allows lookups in a
remote window. When you find what you are looking for you can click 'add'
and it closes that popup window and appends that item to a list in the
original window.
In Opera these windows look completely normal only when you click add, it
simply stays in the box where you typed it and it never appends it to the
list.
Another annoyance with Opera is it doesn't display pages with images in
tables until the entire table is loaded. Many web sites put all of their
content within a table to limit width for printing reasons, thus nothing on
the page shows until all graphics are loaded. You can turn of the loading
of graphics but both Netscape and IE have that feature as well, but IE shows
images in tables while loading. IE never got really fast in loading tables
until version 5.0 and 5.5 is faster. Netscape is slower than Opera at
loading tables, but otherwise about the same.
Also Opera follows Netscapes standard which leaves out many of the advanced
features in web browsers. They say this is because they want their software
to install faster and take less memory. It does accomplish this. IE is a
resource hog but it's gotten better. I guess the final results may be very
different on systems with little resources. IE on a computer with limited
memory resources I'm sure would drag.
Microsoft tends to design older computers into obsolence much more quickly
than most other companies, which has some disadvantages but at the same time
I must give them credit for making use of newer technologies. My Linux
computer runs much faster than my windows machine on shockingly quite a few
things even though my windows machine is technically 2x's the speed. But my
windows machine is way more convienient at this point to totally have me
convert over. If I used my linux machine more I'd definately look into
using Opera over Netscape on it but not at this point while I have my IE.
So, try and decide for yourselves. The Help is great, there are FAQ pages and you get a PERSONAL answer within days.
-
I always surf with Opera 5.O2 and I never had ugly margins...
-
Erik,
Excellent tip on the installation of the plugin - I don't think many people out there have figured out how to take advantage of the fact that the plugin looks for a file called netscape.exe to figure out where to install the plugin, yet. Kudos!
Thanks, as well, for all the info on the browser. I used an older version of Opera years ago to test all my pages, but haven't had a chance to go back since then. Looks like I'll have to give it another go!!! [img]/infopop/emoticons/icon_smile.gif[/img]
Thanks again...
hth,
Deep (just a guy)
<font face="arial" size="2">
Pradeep Kumar Nair, B.Math
Senior Web Designer
http://www.blab.com
ICQ: 39102360
</font>
-
Thanks Erik and Deep for all the insight on this. I have been into web development for several years now and I have never even heard of Opera until now. I guess that tells me that I need to be more current. I also don't really know any other people who are in this line of work. Nobody to "talk shop" with except here.
Thanks,
-
Thank you all for accepting me, who still doesn't have flash (this might be a blasphemy, but I only have Swish which can, of course, not be compared with Flash, but is really handy for text and simple image swf files... [img]/infopop/emoticons/icon_rolleyes.gif[/img] )
I still study a lot, and therefore I download pages to study the coding. Some designers are really geniusses when having to find solutions. So may beautiful approaches of the same detail. But, as the webdesign forum seems to have fallen asleep, permit me to post this little peculiarity here too...
Whilst downloading pages to study the html code, I stumbled on something strange.
Does anyone of you know, or has anyone of you ever met the following "tag" in the intro of a table:
mm:layoutgroup="true"
It is unknown to me, and there are two possibilities: either it is something very new, or it is something that might come from Macromedia's DW4 (mm might well be m(acro)m(edia)) as that app has a layout view, in which case they follow the Microsoft and Adobe example of implanting unnecessary items into their programmes, which will certainly be a disillusion for many users who still believe in DW's "clean" code. Also, it might also be the case if Flash...
Now I don't care to make publicity about something I like, but I do not like this "Big Brother"-like way of wanting to be in control. When you pay for it, it has to be clean, or it should at least be specified that this "spyware" exists so that anyone who is not afraid of the real coding work, may choose for her- or himself to let it be, or delete it.
What do you think? (If it isn't some new tag of course...) [img]/infopop/emoticons/icon_rolleyes.gif[/img]
-
looked it up for me, and posted this quote on the webdesign forum:From John Dowdell - Macromedia Tech Support guy - from a GoLive list :
quote:
"...the new layout tables in Dreamweaver 4 do mark themselves with an "mm:layoutgroup" attribute, instead of the common practice of storing Design Notes in an external XML file, but that's because a table
itself is identified, rather than the meta-data about a file.
It's easy enough to delete these across a site, though... just select that attribute in the HTML and open the Find/Replace dialog... you'll find that selection already entered. Hit "OK" and it will replace that selected text with nothing... poof, gone. You can also set the filter to work across the entire site before hitting OK. Piece o'cake. ;-)"
Must say I'm disappointed.
-
heh - don't be. dreamweaver never put out 'clean' code - no matter what anyone told you. it's handy for certain things here and there, but realistically, if you start coding by hand, it's only a matter of time before you get stuff done quicker and better than most (if not all) of the wysiwyg editors. don't get me wrong - i'm not saying that you should ditch your wysiwyg editor - i'm just saying that if you're using one, you might want to get to know your code a bit better, just in case you go to the point where the wysiwyg editor is more of a hindrance than help.
hth,
Deep (just a guy)
<font face="arial" size="2">
Pradeep Kumar Nair, B.Math
Senior Web Designer
http://www.blab.com
ICQ: 39102360
</font>