Gossamer Forum
Home : General : Internet Technologies :

Browsers

(Page 2 of 2)
> >
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Instead of:
Code:
if (browserName == "Netscape") {
document.write ('')
}else{
document.write ("<img src=\"images/seperator.gif\" alt=\"seperator\">")
}

Try:

Code:
if (browserName != "Netscape")
document.write ('<img src="images/seperator.gif" alt="seperator">');

Last edited by:

Paul: Apr 17, 2002, 2:42 AM
Quote Reply
Re: [Paul] Browsers In reply to
Thanks a lot Paul - that got rid of a lot of errors Smile

But a new one now:

Quote:


Line 28, column 35: ... ages/seperator.gif" alt="seperator">'); ^

Error: element "img" not allowed here; check which elements this element may be contained within
Any ideas on that?

P.S - did you see the end of the golf the other day? I only caught the highlights on the NZ news here. Tiger cleaned them up in that final round.

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------

Last edited by:

Philip_Clark: Apr 17, 2002, 2:59 AM
Quote Reply
Re: [Philip_Clark] Browsers In reply to
Strange...I just tested with:

Code:
<script>
var browserName = navigator.appName;

if (browserName != "Netscape")
document.write ('<img src="images/seperator.gif" alt="seperator">');
</script>

....and it worked fine.

As for the golf...yes I saw it :) ....Vijay and Ernie really bottled it.
Quote Reply
Re: [Paul] Browsers In reply to
Works great yes Cool

Just that the w3.org validator doesn't like it:

Quote:
  • Line 27, column 35: ... es/seperator.gif" alt="seperator" />'); ^

    Error: element "img" not allowed here; check which elements this element may be contained within


  • Any idea why?

    Don't usually like golf but I like following Tiger's progress throughout the tournaments.

    ---------------
    Cricket Web - http://www.cricketweb.net
    Cricket Web Forum - http://forum.cricketweb.net/
    ---------------
    Quote Reply
    Re: [Philip_Clark] Browsers In reply to
    Oh right w3. Their validator has some flaws obviously. If it is cross-browser compatible and works then surely thats all that matters?

    Last edited by:

    Paul: Apr 17, 2002, 4:11 AM
    Quote Reply
    Re: [Paul] Browsers In reply to
    Yeah - just that I wanted to put one of their flashy 100% validation buttons on Wink

    Never mind Smile

    ---------------
    Cricket Web - http://www.cricketweb.net
    Cricket Web Forum - http://forum.cricketweb.net/
    ---------------
    Quote Reply
    Re: [Philip_Clark] Browsers In reply to
    Edit the button and call it a 99% compatible button.

    A lot of people are claiming that the actual validator is flawed, however. There are apparently a lot of better validators (offline, downloadable ones). Try searching http://www.slashdot.org for further discussions about this.

    - wil
    Quote Reply
    Re: [Wil] Browsers In reply to
    Thanks Wil - I'll have a search Smile

    ---------------
    Cricket Web - http://www.cricketweb.net
    Cricket Web Forum - http://forum.cricketweb.net/
    ---------------
    Quote Reply
    Re: [Philip_Clark] Browsers In reply to
    Finally back to this with the code:

    Quote:
    <script language="javascript" type="text/javascript">
    var browserName = navigator.appName;
    if (browserName != "Netscape")
    document.write ('<img src="images/seperator.gif" alt="seperator" />test2');
    else
    document.write ('<br />test1');
    </script>

    Mozilla goes into the else statement and prints the <br> tag. I know Mozilla is Netscape's latest version but is there anything I can do to have different code for the two browsers (Netscape and Mozilla)?

    ---------------
    Cricket Web - http://www.cricketweb.net
    Cricket Web Forum - http://forum.cricketweb.net/
    ---------------

    Last edited by:

    Philip_Clark: May 20, 2002, 5:26 PM
    Quote Reply
    Re: [Philip_Clark] Browsers In reply to
    I am on the conclusion that creating and optimizing your website for IE is more then enough unless you want 100%.
    >> Nakul Goyal (SEO, Link Building Expert)
    Web Site Promotion
    Tips 'n' Tricks
    SEO News


    > >