Created
March 7, 2014 08:16
-
-
Save YusukeHirao/9407468 to your computer and use it in GitHub Desktop.
jQuery `'#'` がセレクターになる場合気をつける。 ref: http://qiita.com/YusukeHirao/items/78f3c8c5354c4fbcc550
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).find('#'); | |
$(document).filter('#'); | |
$(document).not('#'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: Syntax error, unrecognized expression: # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).find('#' + id); // => エラーになる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (id) { | |
$(document).find('#' + id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment