SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Script problem

  1. #1
    SitePoint Enthusiast montroze's Avatar
    Join Date
    Mar 2002
    Location
    Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Script problem

    After having major problems with Netscape 4.7 and CSS I decided to try and re-direct them...this script will just load upmy background and freezes...any ideas why?

    **URL has been changed to protect the innocent***




    <script>
    version=parseInt(navigator.appVersion);if (navigator.appVersion.indexOf('5.')>-1){version=5}; browser='OTHER'; if (navigator.appName=='Netscape'){browser='NS'+version;} if (navigator.appName=='Microsoft Internet Explorer'){browser='MSIE'+version;} if (navigator.appVersion.indexOf('MSIE 3')>0) {browser='MSIE3';} if(browser == 'NS5'){browser='NS6'};if (browser=='MSIE3') {window.location='http://www.accesscomm.ca/index.html'}if (browser=='MSIE4') {window.location='http://www.accesscomm.ca/index.html'}if (browser=='MSIE5') {window.location='http://www.accesscomm.ca/index.html'}if (browser=='MSIE6') {window.location='http://www.accesscomm.ca/testpage.html'}if (browser=='NS3') {window.location='http://www.accesscomm.ca/testpage.html'}if (browser=='NS4') {window.location='http://www.accesscomm.ca/testpage.html'}if (browser=='NS6') {window.location='http://www.accesscomm.ca/testpage.html'}if (browser=='OTHER') {window.location='http://www.accesscomm.ca/index.html'}
    </script>

    Major Netscape problem with CSS so Im trying to send them to another page

  2. #2
    SitePoint Evangelist pip's Avatar
    Join Date
    Jun 2001
    Location
    Cape Town, South Africa
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do not experience the same problem as you. I've tried it on my own sites, and with the URLs entered in your script, but it seemed to be working fine.

    One thing you might want to consider is placing your script in a function, and then launching the function in the onLoad property of the BODY tag. Also, to avoid confusing your browser, specify the language of your script in the script tag.

    I doubt that this would fix your problem tho'. As I said, I tried it and it works fine. But give it a bash... you neva know!
    - Pip
    ---------------------------------------------------------------------------------
    Nothing takes the taste out of peanut butter quite like unrequited love.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hiding style from ns4

    Instead of re-directing, use the @import trick to hide style from ns4.

    in HTML:
    the usual style link
    <link href="general.css" rel="stylesheet" type="text/css">

    in general.css stylesheet:

    @import url(standard.css);
    then the css that netscape can handle

    in standard.css:
    put the css that modern browsers can handle

    the idea is that netscape doesnt support @import, but modern browsers do. netscape will ignore the first line, and just read the css that it can handle. modern browsers will immediately go to the standard.css stylesheet and implement that style.
    this is a very popular technique. do a google group search on "@import" if you want more information. you will find a ton of references.

    thanks to Henri Sivonen for the above explanation

    stevo

  4. #4
    SitePoint Enthusiast montroze's Avatar
    Join Date
    Mar 2002
    Location
    Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Import

    Thanks for the info, 1 thing is that Im not sure what the older Netscape's can handle and what to put into that class file.

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Import

    Originally posted by montroze
    Thanks for the info, 1 thing is that Im not sure what the older Netscape's can handle and what to put into that class file.
    I find that ns4 handles most css quite well. (definitely in the minority here). keep things simple, tell it exactly what you want it do. the css must be valid, and the html it is applied to must be valid.

    the most common problem most people have with ns4 is background images, nesting, hover, and inline styles, none of which ns4 does.

    I have the best luck with a combination of id="someid" for positioning (margins, padding, width,) and class="someclass" for font styles, colors, appearance issues.

    the problems come when people insist that a site look exactly the same in ns4 as in other browsers. ns4 users are used to corrupted sites, so if you give them a site that works and looks decent without all the fancy stuff they will be happy.

    most ns4 users are government, school, institution. a lot of these also disable javascript, which in ns4 means no css. so if you have these kind of users, check that without javascript and css you have a plain text site that flows logically. just a matter of re-arranging the html.

    stevo


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •