This is not possible.
A JSONP request works by creating a <script>
element with its src
attribute set to the request URL.
You cannot add custom headers to the HTTP request sent by a <script>
element.
More Related Contents:
- jQuery and AJAX response header
- AJAX in Chrome sending OPTIONS instead of GET/POST/PUT/DELETE?
- from jquery $.ajax to angular $http
- Cannot properly set the Accept HTTP header with jQuery
- Ajax Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
- jQuery ajax request being block because Cross-Origin
- Display PNG image as response to jQuery AJAX request
- Accessing web Service from jQuery – cross domain
- Preventing “SCRIPT5: Access is denied” error in IE
- json Uncaught SyntaxError: Unexpected token :
- jQuery ajax (jsonp) ignores a timeout and doesn’t fire the error event
- How can I load webpage content into a div on page load?
- How to know when all ajax calls are complete
- Ajax in Jquery does not work from local file
- Ajax request with JQuery on page unload
- jQuery – Illegal invocation
- How to make Asynchronous(AJAX) File Upload using iframe?
- JQUERY ajax passing value from MVC View to Controller
- jQuery – is it bad to have multiple $(document).ready(function() {});
- What is the best way of showing progress on an Ajax call?
- Jquery ajax error callback
- How to call external url in jquery?
- Return Value from inside of $.ajax() function
- JQuery AJAX Consume SOAP Web Service [closed]
- Post JSON to Python CGI
- jQuery ajax and SSL?
- What HTTP status codes count as success in jQuery.ajax?
- handle ajax error when a user clicks refresh
- JQuery ajax call default timeout value
- How do I POST an array of objects with $.ajax (jQuery or Zepto)