HTTPS request using AJAX

HTTPS request using AJAX
0

#1

I’m doing a project for the quote generator and I’m trying to an AJAX request for “quotes.txt” to “quotes.html”. How do I attach an image to show what I’m taking about?


#2

Could you link to your code please?


#3

ncampbell89.github.io/portfolio/quotes.html


#4

To answer your other question, the icon in the reply editor that has an arrow pointing up is how you upload an image. You can also copy and paste it into the reply editor as well.


#5

I see that you are using jQuery. One way to make an Ajax request would be the jQuery $.getJSON() function. It can be used like this:

$.getJSON(url, data, success);

Here, url is the url of the base api you want to get the info from. data is any data you want to send to that server (I don’t know that you’re going to want to use that for this project) and success is the function you want to be carried out once the you reach the api.


#6

ok, I’ve changed my whole javascript file. The only thing I don’t understand is the uncaught type error in the inspection.


#7

Is there a way you can update that link with the new code so I can see what you’re talking about?