Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add header to AnchorTag #162

Open
velinson opened this issue Feb 26, 2018 · 1 comment
Open

How to add header to AnchorTag #162

velinson opened this issue Feb 26, 2018 · 1 comment
Labels

Comments

@velinson
Copy link

Hi,

I need to be able to set header for AnchorTag as in this example with ajax call
$.ajax({
url: '',
headers: { 'Access-Control-Allow-Origin': 'htt://site allowed to access' }
data:,
type:

})

I don't see an option in api for AnchorTag. Is there a work around ?

thanks you in advance

Victoria

@flofourcade
Copy link
Contributor

flofourcade commented Mar 1, 2018

2 options :

  • using onBeforeTopic give you a way to access / modify the jqXhr object and for eg add headers.
  • using $.ajaxSetup in a script tag give you a way ti set up jquery globally for all ajax calls issued by jquery on the page

Note : the use of this header in a request seems unusual. Usually it s found in a web server s response allowing a CORS request ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants