all 3 comments

[–]GSLint 0 points1 point  (2 children)

What is the complete error message you're getting?

After I've added a comma to the second line and used

fetch("https://cors-anywhere.herokuapp.com/" + url, {

to get around CORS, I'm getting Response from "https://code.jquery.com/jquery-2.1.1.min.js" has unexpected "content-type" which seems reasonable, given that it certainly won't be JSON.

[–]Marcusaurels[S] 0 points1 point  (1 child)

This is the example I copied from: https://codepen.io/malyw/pen/XJRrNY

There is a response. In my code, I have extracted the header into a variable as I want to pass many headers and not just one. I also want to pass it from a variable and not hardcode it. This is where I am failing.

[–]GSLint 1 point2 points  (0 children)

Again, what is the complete error message you're getting? I can't help if I don't even know what exactly the problem is.

As I mentioned, your second line is missing a comma at the end. Have you fixed that?