Skip to content

Instantly share code, notes, and snippets.

@mrandrewmills
Created January 10, 2017 22:40
Show Gist options
  • Save mrandrewmills/4360ad9c469ff1209e2035c0905c00f2 to your computer and use it in GitHub Desktop.
Save mrandrewmills/4360ad9c469ff1209e2035c0905c00f2 to your computer and use it in GitHub Desktop.
Challenge: Explain the cause of the bug, and fix it by changing only a single line.
// 1st given: the .get call on line 5 should fire only when .sidebar is present
// 2nd given: the current page does NOT have any element with a .sidebar attribute
if ($('.sidebar')) {
$.get( "ajax/fundraising.html", function( data ) {
$( '.sidebar' ).html( data );
});
}
@mrandrewmills
Copy link
Author

Please post your answers in ROT-13 format (http://rot13.com/), so as to avoid spoiling this puzzle for others.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment