Skip to content

Conversation

thisconnect
Copy link
Contributor

please cherry-pick whatever you like

README.md Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Careful, if you return options, then this function constructor won't work as expected! Although maybe something like this is more useful:

this.options = options || {};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hshoff
Copy link
Member

hshoff commented Dec 14, 2012

Thanks for the PR @thisconnect! Looks like some really nice cleanup.

Before I merge this in, why double quotes for the markup?

@thisconnect
Copy link
Contributor Author

Personally I always use single quotes for JavaScript and double quotes for markup and CSS. This in cases where you have to write markup or style in JavaScript

var element = document.getElementsByTagName('div')[0];

// bad
element.innerHTML = '<a href=\'#\'>link</a>';
element.style.backgroundImage = 'url(\'http://jsfiddle.net/img/logo.png\')';​

// good
element.innerHTML = '<a href="#">link</a>';
element.style.backgroundImage = 'url("http://jsfiddle.net/img/logo.png")';​

or the other way around

<!-- bad -->
<a href='#' onclick='document.write(\'<h1>dont use document.write</h1>\');'>

<!-- good -->
<a href="#" onclick="document.write('nor mix style or behavior with markup');">

But the it doesn't matter for html in markdown. Please just git cherry-pick the commits you like.

See also http://google-styleguide.googlecode.com/svn/trunk/htmlcssguide.xml#HTML_quotation_marks but then the google html/css styleguide also proposes using single quotes for CSS which I don't prefer, since they are clearly wrong :P .

@thisconnect
Copy link
Contributor Author

@h4rry do you want me to try to revert that double quotes commit, so you can just pull?

@hshoff
Copy link
Member

hshoff commented Dec 18, 2012

@thisconnect yes please! that'd be much appreciated 🍻

@thisconnect
Copy link
Contributor Author

Reverted a2fd260 but got a little merge conflict with Compatability -> Compatibility. Should be good now.

@hshoff
Copy link
Member

hshoff commented Dec 18, 2012

Looks great! Thanks!

hshoff added a commit that referenced this pull request Dec 18, 2012
small code example and typo fixes
@hshoff hshoff merged commit 2091d96 into airbnb:master Dec 18, 2012
sensiblegame added a commit to sensiblegame/React-BNB that referenced this pull request Oct 23, 2017
MK825 added a commit to MK825/javascript that referenced this pull request Jan 27, 2023
Binary-Ninja-007 pushed a commit to Binary-Ninja-007/JavaScript_Style_Guide that referenced this pull request Aug 13, 2023
harry908nilson pushed a commit to marcolane/Javascriipt that referenced this pull request Sep 1, 2023
talentdev219 pushed a commit to talentdev219/javascript that referenced this pull request Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants