PARTICLE.JS -- Uncaught ReferenceError: particlesJS is not defined

PARTICLE.JS -- Uncaught ReferenceError: particlesJS is not defined
0.0 0

#1

Hi everyone,

so I’ve been following a tutorial on how to implement Particle.JS and for some reason I’m having an issue stated below. i followed the video exactly, several times and i just don’t understand where I’m going wrong. – Also I’m new and this is something I’m doing out of my bootcamp so i can better understand particle.JS

Basically the issue is that ParticleJS is undefined and won’t load properly.

this is the error I’m receiving:
index.html:18 Uncaught ReferenceError: particlesJS is not defined
at index.html:18
(anonymous) @ index.html:18

Attached is the HTML code:

!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" 
	content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" 
	content="ie=edge">
	<title>Dijitz 2</title>
	<link rel="stylesheet" href="style.css">
</head>
<body>
	<div id="particles-js"></div>

	<script src="https://cdnjs.cloudflare.com/ajax/libs/particlesjs/2.2.1/particles.min.js"></script>

	<script>
		particlesJS.load('particles-js', 'particles.json', function(){
				console.log('particles.json loaded...');
		}); 
	</script>

	<script src="particles.js"></script>
</body>
</html>

any help is appreciated.

thank you!!!


#2

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://freecodecamp.org.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

Happy coding :slight_smile:

Also, I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.