I tend to avoid jQuery but I can read it to get the gist of it. So, I’m not an expert, but in your ajax request url you have “”. So where is the ajax request requesting data from?
I totally understand that you feel like losing your mind, because something doesn’t work as expected.
My suggestions:
I would start with the HTML code, because it is the content of the page:
I would open a new, empty pen
I would go into the old pen and have a look at every single line and write into the old HTML why I added this line, e.g. <!-- I want to see a button to get a new quote --> or <!-- I want to see a box for the name of the author -->
If I’d be sure that I understand all the lines, I would take the line I feel most self-confident about and copy it over into the new pen HTML section
I would do this for every line until something doesn’t work as expected
I would try to understand why it doesn’t work as expected
I would probably find code I don’t understand, that’s why I would not copy it over
Now, after I handled all my HTML code, I would start with the CSS:
I would take the first CSS rule and copy it over and see what happens
If it wouldn’t work as expected, I would read up on it
I would do Step 1 until something doesn’t work as expected
I would try to understand why it doesn’t work as expected
okay so i completely restarted and I feel like I made it simpler now. Also that helped a lot with understanding so thank you… but a quote still wont show up lol
great work,
you re-organized your code and we can use the new quote button!
My ideas:
currently I have to click the button once to see an initial quote; if you want to do something after the site has loaded, you can search for DOMContentLoaded
I think you don’t need the lines <script src="javascipt.js"></script> and <meta name="viewport" content="width=device-width, initial-scale=1">, because codepen already has this built-in
you use var randomNumber = Math.floor(Math.random() * quotes.length); in your code; do you understand what this does?