Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7840587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:50:16+00:00 2026-06-02T15:50:16+00:00

I am using something like this to get an image via jquery ajax. $.ajax({

  • 0

I am using something like this to get an image via jquery ajax.

$.ajax({
   url: imageurl,
   type:'GET',
   contentType: 'image/png',
   success: success,
   error: error,
   timeout: 5000
});

I can see that my request headers include

Access-Control-Request-Headers:origin, content-type, accept

On the other hand, If i set up a img element like

<img src="imageurl" ...

and observe the request headers I don’t see any “Access Control Request Headers”.

Just wondering what is the reason for $.ajax() adding this header. Why is it adding this for a images which should be a valid Cross-site HTTP request. Will it be a good practice or even possible to remove this header?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:50:18+00:00Added an answer on June 2, 2026 at 3:50 pm

    Anything accessed using an XMLHttpRequest will have these headers, whether it’s an image or not. The crucial part is the origin of the request (a script rather than an ‘img’ tag).

    This header is actually created by the browser, so, no, it wouldn’t be possible to remove it via jquery.

    Historically scripts were not allowed to perform cross-site HTTP requests, and these headers are part of the new ‘cross-origin sharing’ feature. See: https://developer.mozilla.org/en/http_access_control

    Note that it may be possible to circumvent by using jquery to generate an ‘img’ tag, which could potentially be manipulated in the way you want. I haven’t tried but it’s worth a try..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently i'm using something like this: images = Image.all() count = images.count() random_numb =
Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger(component)
I'm using something like this on my server: TcpServerChannel channel = new TcpServerChannel(settings.RemotingPort); ChannelServices.RegisterChannel(channel,
Hoping that using something like this demo it is possible to drag items within
After adding elements to page using something like this, $('#blah').append('<div id=bugsbunny></div>'); how can I
Freemarker has the ability to do text escaping using something like this: <#escape x
So, I'm trying to consume a webservice using something like this: $client = new
Writing something like this using the loki library , typedef Functor<void> BitButtonPushHandler; throws a
If I do something like this: using (SqlCommand cmd = new SqlCommand(SELECT * FROM
Is it possible to accomplish something like this using linqtosql? select * from table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.