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.

Challenge fail if #data not selected with double quotes in 'geolocation' challenge

See original GitHub issue

Challenge Name

https://www.freecodecamp.com/challenges/get-geolocation-data

Issue Description

Go through the challenge and do:

$('#data').html(...) and it will fail.

change to $("#data").html(...) and change nothing else, and it will work.

Many js developers prefer to use single-quotes in js and double quotes in html. Additionally, the other jquery challenges do not have this bug.

Browser Information

  • Browser Name, Version: Chrome Stable 64bit 54.0.2840.99m
  • Operating System: Windows 10 64 bit
  • Mobile, Desktop, or Tablet: Desktop

Your Code

 
<script>
  // Only change code below this line.
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function (position) {
      $('#data').html('latitude: ' + position.coords.latitude + '<br>longitude: ' + position.coords.longitude);
    });
  }
  
  
  // Only change code above this line.
</script>
<div id = "data">
  <h4>You are here:</h4>
  
</div>

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dhcodescommented, Nov 19, 2016

@systimotic I believe the style guide they are referencing is this: http://contribute.jquery.org/style-guide/js/#quotes

But yes, I agree we should drop the requirement as it’s not a hard rule.

1reaction
systimoticcommented, Nov 18, 2016

Wow, thank you @abhisekp, I did not know about that! That is pretty amazing ✨ A PR resolving this issue should probably also get rid of this test. It quotes a jQuery style guide, which I have not been able to find. The entirety of the jQuery challenges seed has to be updated, as well as some of the JSON API’s and AJAX seed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Challenge fail if #data not selected with double quotes in ...
Challenge Name. https://www.freecodecamp.com/challenges/get-geolocation-data. Issue Description. Go through the challenge and do:.
Read more >
how to avoid [Missing close double quote (") character.] error ...
I think I found a solution. When I try to upload the data to google bigquery directly it doesn't show those options in...
Read more >
Escaping double quotes from source file while loading data
Solution: Double quotes present in the source file can cause data loading challenges, e.g. when a field is enclosed in double-quotes and the ......
Read more >
EQL syntax reference | Elasticsearch Guide [8.5] | Elastic
Use enclosing double quotes ( " ) or three enclosing double quotes ( """ ) to escape event categories that: Contain a special...
Read more >
Bulk API 2.0 and Bulk API Developer Guide
The REST-based Bulk API 2.0 provides a programmatic option to asynchronously upload, query, or delete large data sets in your Salesforce.
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