Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript browser detection

Reply
Thread Tools

Javascript browser detection

 
 
Tharnack
Guest
Posts: n/a
 
      07-20-2004
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.
 
Reply With Quote
 
 
 
 
Ivo
Guest
Posts: n/a
 
      07-20-2004
"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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mobile browser detection and redirection Carlos ASP .Net 4 08-11-2009 08:28 AM
Browser detection Roger ASP .Net 5 12-11-2007 06:04 AM
browser detection and redirection jaydev HTML 41 10-27-2006 02:53 PM
browser detection and redirection jaydev ASP .Net 1 10-23-2006 08:53 PM
browser detection for mobile devices Phil Townsend ASP .Net 1 12-02-2004 05:20 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57