So I’m having a problem with my code using brackets.io. Like most beginners on freecodecamp I began learning using codepen.io.
Here is my problem:
as you can see here I’m linking to a .js file using the script tag, but the problem is that it’s not linking to my .js file…
however, if I write my script tags like so…
I have looked up many sources online and have not figured out how to solve this small problem yet…
It seems many others are having this problem with brackets.io
Any feedback would be greatly appreciated.
I don’t know if it is an artifact of the cutting and pasting, but your code is missing several brackets. For example:
Assuming your version is correct, and main.js is in the same directory, that should work. Another way to see what is happening is to check the dev tools network tab see if that file is loading. Without more information, I don’t see how we can help you. Try reducing the files and directory structure down to the bare minimum. If you are still having a problem, you can post what you have.
You mentioned codepen. Yes, it is a little frustrating when going from codepen to “real” coding, but it’s a big confusion over just a few things that doesn’t last too long. Also, codepen will output a directory structure of any project into a zip file that you can unzip and see exactly how that project would look in the “real world” with files and folders and everything. On the lower right, go to export -> export-to-zip.
If none of that works, I would checkout youtube. I’m sure there are simple videos of people stepping through building simple pages.
Let us know if we can help more.