question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dead links challenge should not mention jQuery

See original GitHub issue

Challenge Make Dead Links using the Hash Symbol has an issue. User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2902.0 Safari/537.36.

Old Issue Description:

Sometimes you want to add a elements to your website before you know where they will link.

This is also handy when you’re changing the behavior of a link using jQuery, which we’ll learn about later.

This is bad advice. You should avoid links that point to #, unless you want a basic “go to the top” link. If you want to make something that is not pointing to another page, use a <button> element instead. You can style that button to look like a link if you have to. But <a> means “points to another page”.

(I’m not saying that giving some click handler to an <a> is wrong in all cases, of course. Replacing an <a> with something that loads the link without reloading (aka AJAX) is fine.)

Updated Description: New challenge title: Make Link Placeholders using the Hash Symbol

New description: When developing a website you often want to check the behavior and looks of a page before you connect it with the rest of the website. For example, You want to check how a link looks when clicked without it causing the browser to move to another page.

That’s where placeholder links come handy.

For <a> element to be a link it must have href attribute (otherwise it is rendered just like a normal text). There’s a tradition in developer community for creating placeholder links by assigning href attribute to # symbol.

# symbol is actually a valid fragment identifier - a shorthand for the top of the page. So, when you’re not at the top of the page be warned that clicking on the placeholder link will move you back to the top.


code formatting removed by @abhisekp - 30th Nov. 2016 - 7:30 AM IST

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:25 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
marzelincommented, Nov 29, 2016

New challenge title: Make Link Placeholders using the Hash Symbol

New description: When developing a website you often want to check the behavior and looks of a page before you connect it with the rest of the website. For example, You want to check how a link looks when clicked without it causing the browser to move to another page.

That’s where placeholder links come handy. For <a> element to be a link it must have href attribute (otherwise it is rendered just like a normal text). There’s a tradition in developer community for creating placeholder links by assigning href attribute to # symbol. # symbol is actually a valid fragment identifier - a shorthand for the top of the page. So, when you’re not at the top of the page be warned that clicking on the placeholder link will move you back to the top.

1reaction
raisedadeadcommented, Oct 29, 2016

Is this a bad practise, yes sure it is. But at this point in the challenge the campers especially new campers are learning the basic concepts of the language.

Sure we can tell them that this should have been a button with some magic styling that looks like a link, but I am sire you would see how overwhelming that sounds for a beginner.

To my opinion we should be focused on getting the basics correct, and the best practices can chime in in actual projects when the core concepts are through for a camper.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dead links challenge should not mention jQuery · Issue #11441
As the challenge indicates, the # is used as a placeholder link whilst in development. Without it, the page you are developing will...
Read more >
JavaScript/jQuery check broken links - Stack Overflow
Issue is that JavaScript has the same origin policy so you can not grab content from another domain. This won' ...
Read more >
Enhance Your MVC Applications Using JavaScript and jQuery
In this first of a multi-part article series, I'm presenting an MVC application written with all server-side code to which you are going...
Read more >
Stealing tokens, hacking jQuery and bypassing Same-Origin ...
In this article: You will learn an interesting way to read tokens from another domain. You will learn how to make XSS using...
Read more >
FreeCodeCamp/Help - Gitter
I'm not sure how to get jQuery running on my text editor. This is the code and I'm trying to do the hinge...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found