I am working on udacity design patters course. There are giving materials and I have implemented some onto it then tried to debugging. However it gives me the error saying I have no linked to jQuery even though it had been defined as
<script src=".11.1/jquery.min.js"></script>
<script src="js/retain.js"></script>
on separate index.html file
Because the files were provided by the course, it should be written correctly. So I must do something beforehand...
I am new to JS code, searched & going through many videos but still have no ideas: (I have set config.json (as asked on introduction video ;t=103s). I would be appreciated if anyone can help in anyway! (or anyone can direct me to good tutorials of debugging on VS Code ). Thank you in advance.
I am working on udacity design patters course. There are giving materials and I have implemented some onto it then tried to debugging. However it gives me the error saying I have no linked to jQuery even though it had been defined as
<script src="http://ajax.googleapis./ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="js/retain.js"></script>
on separate index.html file
Because the files were provided by the course, it should be written correctly. So I must do something beforehand...
I am new to JS code, searched & going through many videos but still have no ideas: (I have set config.json (as asked on introduction video https://www.youtube./watch?v=6cOsxaNC06c&t=103s). I would be appreciated if anyone can help in anyway! (or anyone can direct me to good tutorials of debugging on VS Code ). Thank you in advance.
Share Improve this question edited Aug 13, 2017 at 7:59 marc_s 756k184 gold badges1.4k silver badges1.5k bronze badges asked Aug 5, 2017 at 18:36 IchiIchi 3692 gold badges4 silver badges11 bronze badges 7- Is this a runtime error or an error in VS Code? – Matt Bierner Commented Aug 7, 2017 at 17:47
- This is VS code error, it cannot recognize $. – Ichi Commented Aug 10, 2017 at 21:33
-
Can you please explain what that means. Are you not seeing the expected suggestions on
$
or is there another error? – Matt Bierner Commented Aug 11, 2017 at 6:29 - Sorry for late reply, when I run debugging on JS, it throws error as --- Exception has occurred: Error ReferenceError: $ is not defined at Object.<anonymous> (/Users/satokoichimura/Document/Cat_Click_Premium/js/app.js:2:1) at Module._pile (module.js:570:32) – Ichi Commented Aug 17, 2017 at 17:37
- That looks like an error with your code. How are you starting the debugger? If you are starting debugging on just that file, jquery will not be loaded since its only referenced from the html file – Matt Bierner Commented Aug 17, 2017 at 21:52
2 Answers
Reset to default 2Debugger type
should be Chrome
There's a configuration file under the ".vscode" folder, named "launch.json" which allows you to select the type of environment where your debugger needs to run. If you select your debugger type as "Chrome" you should be able to debug the script browser-side on Chrome.
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch index.html",
"type": "chrome",
"request": "launch",
"file": "${workspaceFolder}/index.html"
}
]
}
I had no idea what I was doing. Now I know there is no debug tool for JS frontend only project, all I can do is just go to development tool or usual console.log to see where a bug could be. Phew.