Re: [IUG] Cite this from OCLC - need help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Date: Fri, 19 Dec 2008 10:11:56 -0800
- From: "David Jones" <djones at scu dot edu>
- Subject: Re: [IUG] Cite this from OCLC - need help
>>> On Fri, Dec 19, 2008 at 8:26 AM, in message
<D974078B534F5842AD60E246F3368E62059F2D7168 at mail1 dot alliant dot edu>, Heather Parker
<hparker at alliant dot edu> wrote:
> What is the different between the using " and ' in the javascript? I noticed
> that this corrected version has ' instead of ".
Single quote vs. double quote? Emacs vs. vi? Mac vs. Windows...
It matters only in how much escaping you want to do and what it is your are producing. If you are creating a lot of (X)HTML with your javascript (and is javascript even good for anything else?), then it's better to use one in your javascript and one in your (X)HTML.
If you quote your HTML attributes in double quotes, use single quotes in your javascript.
If you quote your HTML attributes in single quotes, use double quotes in your javascript.
Either way, always use the same in each or you're in for a world of hurt. I've always double-quoted my (X)HTML attribute values, so I always use single quotes in my javascript.
HTH,
David
_____________________________________________________________________
David Jones mailto:djones at scu dot edu
Library Systems Manager http://www.scu.edu/library/
University Library fax: 408-551-1805
Santa Clara University phone: 408-551-7167
500 El Camino Real
Santa Clara CA 95053-0500
_____________________________________________________________________
Reality is that which, when you stop believing in it, doesn't go away.
-- Philip K. Dick