Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Apostrophes or Quotation Marks?

Hi, guys-- I'm not that familiar with HTML coding and am getting into the character sheets feature here, but noticed that the Roll20 Wiki instructions vary in whether they use apostrophes or quotation marks in the HTML code. For instance: <input type="text"> <input type='checkbox' name='attr_HasShield' value='1' checked='true' /> The first of those uses quotations, while the second uses apostrophes. They both appear to work with regard to character sheets, but is one of those the standard that we should be following? O_O
1427400770

Edited 1427400782
Kryx
Pro
Sheet Author
API Scripter
They both work. As a HTML standard you should use a double quote. This is because inline JS/CSS can sometimes be put into html and those both use single quotes. But it doesn't really matter for roll20.
Okay, thanks. If quotes are the standard, I'll go with the quotes! :-)
1427418435
Lithl
Pro
Sheet Author
API Scripter
Actually, in many cases it is legal HTML to not use either . Here's an article on the whens and whyfores that's pretty easy to read (and also covers when you can omit quotes in the CSS): <a href="https://mathiasbynens.be/notes/unquoted-attribute-values" rel="nofollow">https://mathiasbynens.be/notes/unquoted-attribute-values</a>
1427446019
Kryx
Pro
Sheet Author
API Scripter
Brian said: Actually, in many cases it is legal HTML to not use either . Here's an article on the whens and whyfores that's pretty easy to read (and also covers when you can omit quotes in the CSS): <a href="https://mathiasbynens.be/notes/unquoted-attribute-values" rel="nofollow">https://mathiasbynens.be/notes/unquoted-attribute-values</a> That's a bad practice as class="foo bar" is entirely different from class=foo bar.
1427447289
Lithl
Pro
Sheet Author
API Scripter
Mark said: Brian said: Actually, in many cases it is legal HTML to not use either . Here's an article on the whens and whyfores that's pretty easy to read (and also covers when you can omit quotes in the CSS): <a href="https://mathiasbynens.be/notes/unquoted-attribute-values" rel="nofollow">https://mathiasbynens.be/notes/unquoted-attribute-values</a> That's a bad practice as class="foo bar" is entirely different from class=foo bar. I did say "many", not "all". And I believe the article I linked uses that exact example.
I did notice that actually there's one thing in Roll20 that doesn't appear to work with apostrophes at all: roll templates. When I tried setting one of those up with apostrophes the game wouldn't recognize it. When I changed apostrophes to quotes, changing nothing else, it worked. Not sure if that was a bug or if that part of the code is just holding things to the standard, but there you have it.