-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Number Game Errors: Move script inside body tag (#775)
## Because In the ["What went wrong?" exercise](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_went_wrong), there is a warning about line numbers in error messages potentially not matching source code line numbers due to code injection from extensions like live-server. This is a result of the code's script tag being placed *after* the closing body tag, so live-server's injected code comes before it. By placing the script tag *before* the closing body tag, live-server injects code after it, preserving line numbers in the error messages, making the lesson much easier to follow for more people. The relevant warning can then be removed from the lesson. This has been tested with [VSCode's Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer), [VSCode's Live Preview extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server) and the [live-server npm package](https://www.npmjs.com/package/live-server). ## This PR - Moves the closing body tag down *after* the script tag closes. - Fixes inconsistent indentation across the file to only use 2 spaces per level (rather than mixing spaces and tabs). - Uses appropriate indentation for each block as necessary. ## Additional information This PR depends on (mdn/content#36541) which amends the line number references and screenshots in the lesson itself to match what these code changes will produce.
- Loading branch information
1 parent
37f6787
commit f262a5a
Showing
1 changed file
with
87 additions
and
89 deletions.
There are no files selected for viewing
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