Random quote machine and bootstrap/dependencies help

Random quote machine and bootstrap/dependencies help
0

#1

Hey Campers!

I’ve got a bit of a problem, i was researching APIs and came across something called Bootstrap, and then something else that i had to install to install bootstrap or something idk IT DOESNT MATTER.

What the problem is, is that seeing how i might need to download some stuff to get my code to work, i decided to just copy and paste the code from the sample random quote generator into mine, just to see if it works. it didn’t work at all, and it’s got me wondering why this is the case. are there dependencies that i don’t have? is there code put in place to stop people from just copying and pasting code and cheating their way to the qualification? If anyone knows the answer to this and the question of if i need to download this Bootstrap business to start creating projects, please get back to me!


#2

It would be helpful if you could include a codepen link reproducing your problem.

The only dependency that bootstrap has is jQuery. Make sure you have jQuery included before bootstrap.min.js.

Hope this helps.


#3

Let’s see if we can clear this up.

Bootstrap is a common and powerful framework. In fact, it is part of the FCC curriculum. It is not part of standard HTML/CSS/JS so it must be added.

If you are making a web page on your computer, you can include them with lines like:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

This is going out to the web and finding these files to include. You put these in your HTML file. Instead of going out on the web, some people prefer to download the files and link/script to those local files. That is fine too. There are arguments for and against each. I find the first option easier. But you don’t have to “install” Bootstrap if you link/script to remote versions of it, as shown above.

If you are writing in codepen, things are a little different. Yes, you could include those link/script files like above (but not the local version) but codepen prefers that you do it in their program, going to settings/css/quick-add and settings/javascript/quick-add. Codepen likes to take care of all the header info in your HTML. When you want to convert it to a local file system, in the lower right is export/export zip and that will put all the right header info in place and set up the file system for you.

One of the frustrating things about codepen is that you skip over some of the parts of how these files are normally put together. But once you figure it out, it’s pretty easy.

I hope this helps.


#4

thank you very much, your response was fantastic! Could i perhaps ask you another question about a different exercise?


#5

Of course, that’s what the forum is for. I would suggest opening a new topic though so the title will be right and we can get others involved.

Don’t be shy about asking. This is a very helpful and supportive bunch.