Javascript browser detection

Discussion in 'Javascript' started by Tharnack, Jul 20, 2004.

  1. Tharnack

    Tharnack Guest

    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.writeln()
    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.
    Tharnack, Jul 20, 2004
    #1
    1. Advertising

  2. Tharnack

    Ivo Guest

    "Tharnack" wrote
    > 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.writeln()
    > 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.


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

    document.write( ' Funny, isn \' t it? ' );
    HTH
    Ivo
    Ivo, Jul 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Townsend

    browser detection for mobile devices

    Phil Townsend, Dec 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    733
    bruce barker
    Dec 2, 2004
  2. Carlos
    Replies:
    4
    Views:
    21,896
    amimpat
    Aug 11, 2009
  3. jaydev

    browser detection and redirection

    jaydev, Oct 23, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    439
    Mark Rae
    Oct 23, 2006
  4. jaydev
    Replies:
    41
    Views:
    1,455
    Chaddy2222
    Oct 27, 2006
  5. Roger

    Browser detection

    Roger, Oct 28, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    471
Loading...

Share This Page