-1

I'm sending an XMLHttpRequest to a tracking pixel whenever my page loads.

It's getting a 200 response code, but I can see where the status shows CORS error in Developer Tools.

Is my request still being sent, but I'm just not able to see the response due to the CORS errors?

Since it's just a tracking pixel and not an API, I don't need to get the response, just need to make sure that URL is being hit.

xowim46108
  • 97
  • 1
  • 4
  • 1
    Does this answer your question? [Understanding CORS](https://stackoverflow.com/questions/25845203/understanding-cors) – niceman Aug 21 '22 at 17:49

1 Answers1

1

Simple requests are always sent, but access to details of the response may be blocked by the Same Origin Policy if permission isn't granted by the server using CORS.

Preflighted requests such as those including cookies or changes (outside a limited safe set) to HTTP request headers will trigger a preflight OPTIONS request. The request JavaScript wants to send will not be sent unless the response to the preflight is used to grant permission.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335