Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why Does Netscape suck?

Status
Not open for further replies.

Coderifous

Programmer
Dec 13, 2001
782
US
I'm a perl programmer, but I routinely have to mess with Javascript. My goal is ( as always ) to have the same ( or atleast similar ) results on both IE and Netscape.

In general, I am able to get results using IE much easier than I am with Netscape. Even with simple stuff. What is it with Netscape that precludes it from parsing JS half as well as IE? I don't believe that IE is able to read my mind and just know what I want to see happen, but I swear that's what's happening.

I have a page with seven layers ( <div> content </div> )
and I set their style attribute to 'hidden' ( yes, each <div> has a unique ID, and I set their positions to absolute with in the style parameter ). In IE, it's beautiful, you see nothing. In Netscape, voila! All but the first div are visible. What the hell?

I have problems like this all the time. Why doesn't someone decide on a standardized browser? I swear - it would be much easier.

OK, I'm done ranting. Thanks guys.

--Jim
 
I am used to problems between versions and I do admit that Netscape 4 was a big problem. Could you send us your source code so we can have a look?
 
I have to agree 100% on the Netscape issues, but one thing to consider is that it causes coding to be better as it doesn't let stuff slide by like M$IE does...but I still Hate it. :)
 
Hello Coderifous,

Like you I don't like Netscape and its strange
behaviour, but I assure you that, in that case,
you shouldn't have problems with such a simple
thing.

Layers are rendered the same like IE in Netscape.
The only thing you have to know is that you should
avoid layers when using frames. They are unusable
on the MAC version of netscape.

Below is the cross-browser code I always use with NO problems.

// cross-browser show/hide layers----------------------------- START ------------->
function getStyleObject(objectId) {
if(document.getElementById && document.getElementById(objectId)) {
return document.getElementById(objectId).style;
} else if (document.all && document.all(objectId)) {
return document.all(objectId).style;
} else if (document.layers && document.layers[objectId]) {
return document.layers[objectId];
} else {
return false;
}
}

function showLayer(objectId) {
var styleObject = getStyleObject(objectId);
if(styleObject) {
styleObject.visibility = &quot;visible&quot;;
return true;
} else {
return false;
}
}

function hideLayer(objectId) {
var styleObject = getStyleObject(objectId);
if(styleObject) {
styleObject.visibility = &quot;hidden&quot;;
return true;
} else {
return false;
}
}
// cross-browser show/hide layers----------------------------- STOP ------------->

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

#layer1 { position: absolute; z-index: 12; top: 0px; left: 300px; width:470; height: 100%; visibility: hidden }

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

If the problem still occurs, it could come from the HTML
source and not the javascript code.

Also, be sure to put your div layers always just under the
body tag. On IEMAC, you would have a bad surprise if you had the idea to put them all at the bottom of the html code.

Have fun!



 
I'd suggest this JS for hiding/showing, but you might prefer Sleidia's method better.
[COLOR=aa0000]
Code:
get=document.all?function(d) { return document.all[d]; }:
document.layers?function(d,l,_,i) {
 if (!l) l=window;
 if (_=l.document[d]) return _.style=_;
 for (i = 0,l=l.document.layers; i < l.length; i++)
  if (_=get(d,l[i])) return _;
}:
function(d) { return document.getElementById(d); };
[/color]
Then, whenever you need to show or hide a div:
[COLOR=aa0000]
Code:
get('myDiv').style.visibility=&quot;visible&quot;;
get('myDiv').style.visibility=&quot;hidden&quot;;
[/color]

Keep in mind that if you want your code to work for Netscape 4, the DIV has to be relatively or absolutely positioned ([COLOR=aa0000]
Code:
style=&quot;position:relative;&quot;
[/color]).
Code:
- UNIMENT
 
Coderifous- I totally agree with you. IE reads my mind too! - you aren't the only one! LOL Things in IE just seem to flow better, and it is definitly a lot more forgiving. I say forget a standardization... why dont we all just give up on Netscape (yes, I'm sorry: Netscape has died) and work to better the world by optimizing for IE? all this ranting is making me sleepy...

btw UNIMENT... you dont happen to love javascript do you? The things you come up with are amazing! I understand your code and everything, but I would never think to write things as well as you do! The code you posted above is great! Thanx! Where'd you learn your javascript? -gerrygerry
Go To
 
Thanks alot everybody.... it's good to see that I'm not the only one. gerrygerry: exactly who do we talk to, in order to begin 'shifting the paradigm'. I totally agree - just toss netscape. Microsoft may be the evil empire - but even if we all hate their OS' and business strategy, they have put out one extrememly fine product: Internet Explorer
Alright - where do I sign my name? And who's signing with me? Should we petition the W3C? They seem to be 'in charge'. They are all about 'standardization' and 'uniformity', so they should love this idea. OOOOooohh! I'm excited!

--Jim
 
gerrygerry, I learned JS from looking at other people's code and from looking at the docs. I learned to code the way I do by experimenting a lot and by thinking a lot ;-)

I also think that some day I should create a new programming language based on JavaScript (I *almost* love JavaScript, but I think it's too weak and the cross-browser issues really blow -- not to mention that JS is nowhere near as object-oriented as I would like it to be)


But basically, my coding practices came from months of experimentation while making scripts. You should find a way to quickly edit and test HTML so you can discover things about JavaScript syntax and the JS core. Personally, I use something I made called HTMaker:
Code:
- UNIMENT
 
Hey... that &quot;instant js tester&quot; is a good idea UNIMENT! Mind if I use that?

I guess the difference is the docs... I never read any of those, I just used my knowledge of C and worked from there by looking other peoples stuff. Could you give me the URL's you use as references?

From my experiences, I think I agree with your complaints about javascript... I have aspirations of making a language similar to js too. I dont know about the OOP problems, can't you can come close by creating your own objects and such? -gerrygerry
Go To
 
The reference I use most often is

Particularly, I use this reference whenever I need to learn something about the core. But as far as programming technique or DOM-access goes, you should do experimentation.

The OOP problems I refer to are things like...
1. No operator overloading
2. No inheritance
3. No capability to access a function's grandparent
4. No capability to access a function through itself other than by name
5. The [COLOR=aa0000]
Code:
typeof
[/color] operator should relate to the constructor instead of the &quot;basic type&quot;
And I think there were more that I can't remember. I should write these all down so when I make a language, I'll remember what to do. :)
Code:
- UNIMENT
 
Wow UNIMENT... you've really given that some thought! maybe I'm still a way off from making my own langage, but someday I will!

Code:
[arrogant_rant]
grumble ...if I could just pass my english class maybe I could focus a little more on whats important... grumble... grumble... it seems like most of the people in these forums are in the UK... that's not fair to the American programmers! ...grumble.... while you write programs, we're stuck in english class!
Code:
[/arrogant_rant]

LOL

Thanks for your time UNIMENT! -gerrygerry
Go To
 
Isn't Netsuck down to a 7% market share now? And most of that is 6.0, which is much more forgiving than the earlier versions we've all had to wrestle with (4.72, *cough cough*).

I'm finding it less important to worry about pre-6.0 versions of Netscape as time goes on... YAY!
 
good point gerrygerry.

But Netscape 4.0 was wonderful at the time! :) Way back when! LOL

Thing is today we should only support IE4+, Mozilla 1.0(in a month or so) and Netscape 6.2

As a general rule when I write a contract for a proposal I offer support to a major version but only it's latest release. For example Netscape 6 would be Netscape 6.2 etc.. Gary Haran
 
We have to cover 4.7+ and above at my company, it is bad. I can't even say, &quot;netscape can't do that&quot; I just have to find a way =/
 
The biggest problem I find with compatability is layers and such -> if it gets too much, I just give in to the temptation of Flash.

Even then.... grrrrr... just thinking about Netscape makes me wanna go hit something... brb

..much better. LOL

I am never afraid to make a site look a lot better in IE -> I think this'll encourage people to stop using Netscape because everything'll look terrible in it! Well, maybe not that extreme, but I feel like I'm making a difference ;-) -gerrygerry
Go To
 
xutopia,
What about Opera?
I use it for years and always say that it is the best choice for advanced user. It's standards support in almost the same as in Mozilla/N6, excluding some issues.
I also support it in all my works, as well as IE/N6 and NN4 if possible.

Also, it is good to experiment with the latest technologies available, but it doesn't seem to be wise to support only the latest browser updates in &quot;real&quot; projects. Most part of the users do not rushing to upgrade right after some new release.


gerrygerry,
>>I am never afraid to make a site look a lot better in IE -> I think this'll encourage people to stop using Netscape ... ...
I could call it an idiot thing but I'll be polite and will not do this.
As I said once, such words do not add admiration form others.

The one who wants to do makes an effort, the one who doesn't want looks for excuses.

good luck
 
I probably don't give Opera enough of a chance but I found its behaviour far different than IE or Netscape when dealing with CSS. Despite stating it has better support for CSS1 than any other browser.

Maybe because IE and Netscape/Mozilla don't support a full implementation of CSS1 my code is not totally standards compliant and Opera has a hard time dealing with my CSS.

Applications I build rely heavily on CSS1-2 and ECMAScript (That is JavaScript for those of you who wanted to know). I am moving as much as possible towards standards compliance with XHTML 1.0, CSS 1-2 and ECMAScript-262. But frankly sometimes it is really way too hard to deal with all the browser differences and unfortunatly Opera is different (and better in many ways) and I can only support so many different peculiarities and Opera is not the browser of choice for the clients of the product I build.

I hope that one day all browser will have an equal chance that way we can use whatever we want and be sure that it will work.

My dream is :

if (navigator.appName = &quot;anything&quot;)
{
browseFreely()
}

But for a while we have to adapt to DOM 1 and as programmers use as much as possible the standards that do exist. Gary Haran
 
Dear starway:

What's wrong with encouraging a uniform stand for coding? Do you enjoy having to write the same code three times for the three major browsers (in extreme examples)?

IE holds about 80-90% of the users minimum (per my site's stats). Netscape holds about 8-15%, and Opera takes the rest. I dont purposly make site ugly in Netscape, but i'm not going to go out of my way with 200% the code to appease 8-15% of the stubborn market.

IE is a great product and has few shortcomings. Although it may not be totally compliant, it doesn't have to be - it is becoming the new standard, by force.

By trying to make everything work the same with different code for every browser, designers are only reducing the need to develop a standard. That's all I am trying to say. [

This is not an excuse, it is an effort.

BTW, In my experience, developers are the only people out there that use Opera. Everyone else generally uses the IE that came with their OS (another issue). IE is automatically updated with the &quot;windows update&quot;, no? Now that'd be a nice standard! AS far as I know, the average user doesn't even know what IE is, let alone Opera. Allowing Opera to be a concern only contributes to the dissemination of coding variations and varying standards.

I'm not saying that we should all make our pages IE only or anything, but we should push much harder to establish a preference of browsers and stick with it.

-gerrygerry

Go To
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top