Results 1 to 3 of 3

Thread: document.write not working in NS

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    here is my code.
    this works in IE and not in NS4.7.

    <script language='JavaScript'>
    <!--
    var ns = (navigator.appName == 'Netscape');
    var ie = (navigator.appName == 'Microsoft Internet Explorer');
    //var disnavsize='';
    var d = window.document;

    if(ns) {disnavsize='10'};
    if(ie) {disnavsize='9'};

    document.write("<style type='text/css'>");

    document.write('A.DisNav {color:#666666;font-weight: bold; font-size:' + disnavsize + 'px; text-decoration: none; font-family: Arial, helvetica;}');
    document.write('A.DisNav:hover {color:#9ccc99;}');
    document.write('</style>');
    -->

    </script>

    <a class=DisNav href="#"><br>testing</a>


    the style sheet gets ignored completly in NS

    any suggestions?

    thanks
    pnj

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    I dont think that verion of netscape supported those CSS elements
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    it does

    it works if i don't use document.write but I need to change the size of the text depending on what browser the user has.

    this works in both IE and NS execpt for the hover property isnt supported in NS

    <style>
    A.Test
    {
    BACKGROUND-COLOR: white;
    COLOR: #cc6666;
    FONT-FAMILY: Arial, 'MS Sans Serif', helvetica;
    FONT-SIZE: 12px;
    FONT-WEIGHT: bold;
    LINE-HEIGHT: 11px;
    }
    A.Test:hover
    {
    color:#999999;
    }
    </style>
    <a class=Test href="#"><br>testing</a>

    but like I said, i need to use document.write
    pnj

Posting Permissions

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



Click Here to Expand Forum to Full Width