Javascript browser detection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tharnack

    Javascript browser detection

    Hi,
    I have some html code i would like to be printed to the page only if the
    browser has javascript enabled. I have tried to use document.writel n()
    but the string i want to print bot contains some ' and " in it. I don't
    know how to set the delimiters of the string that is passed as argument
    so that i don't get an error in the page.
  • Ivo

    #2
    Re: Javascript browser detection

    "Tharnack" wrote[color=blue]
    > I have some html code i would like to be printed to the page only if the
    > browser has javascript enabled. I have tried to use document.writel n()
    > but the string i want to print bot contains some ' and " in it. I don't
    > know how to set the delimiters of the string that is passed as argument
    > so that i don't get an error in the page.[/color]

    " can be escped as \" or " or "
    ' can be escaped as \' or ' or '

    document.write( ' Funny, isn \' t it? ' );
    HTH
    Ivo


    Comment

    Working...