Tag: jquery

61 votes
17 answers
2.4K views
Jquery - How to make $.post() use contentType=application/json?

I've noticed that when using $.post() in jquery that the default contentType is application/x-www-form-ur

avatar
Chaya
0 1 0 9
asked 07 September, 2021
66 votes
23 answers
2.9K views
jQuery $.ajax(), $.post sending "OPTIONS" as REQUEST_METHOD in Firefox

Having trouble with what I thought was a relatively simple jQuery plugin... The plugin should fetch data from

avatar
Deedee
0 1 0 9
asked 07 September, 2021
54 votes
9 answers
790 views
How can I add a custom HTTP header to ajax request with js or jQuery?

Does anyone know how to add or create a custom HTTP header using JavaScript or jQuery?

avatar
Rudy
0 1 0 9
asked 07 September, 2021
54 votes
11 answers
2.4K views
Why is jQuery's .ajax() method not sending my session cookie?

After logging in via $.ajax() to a site, I am trying to send a second $.ajax() request to that site - but when

avatar
Don
0 1 0 9
asked 07 September, 2021
47 votes
8 answers
1.4K views
Access Control Request Headers, is added to header in AJAX request with jQuery

I would like to add a custom header to an AJAX POST request from jQuery. I have tried this: $.ajax({ ty

avatar
Sena
0 1 0 9
asked 07 September, 2021
59 votes
10 answers
2.5K views
Uploading both data and files in one form using Ajax?

I'm using jQuery and Ajax for my forms to submit data and files but I'm not sure how to send both da

avatar
Basil
0 1 0 9
asked 07 September, 2021
61 votes
20 answers
1.7K views
Handle file download from ajax post

I have a javascript app that sends ajax POST requests to a certain URL. Response might be a JSON string or it

avatar
Lynette
0 1 0 9
asked 07 September, 2021
51 votes
11 answers
2.1K views
Use basic authentication with jQuery and Ajax

I am trying to create a basic authentication through the browser, but I can't really get there. If this

avatar
Boyd
0 1 0 9
asked 07 September, 2021
50 votes
25 answers
2.8K views
Download a file by jQuery.Ajax

I have a Struts2 action in the server side for file downloading. <action name="download" class="com.xxx.Do

avatar
Mikki
0 1 0 9
asked 07 September, 2021
57 votes
14 answers
2.3K views
jQuery AJAX cross domain

Here are two pages, test.php and testserver.php. test.php <script src="scripts/jq.js" type="text/javascri

avatar
Hildegard
0 1 0 9
asked 07 September, 2021
60 votes
9 answers
1.9K views
jQuery get textarea text

Recently I have started playing with jQuery, and have been following a couple of tutorials. Now I feel slightl

avatar
Xavier
0 1 0 9
asked 07 September, 2021
55 votes
13 answers
2.1K views
Sending multipart/formdata with jQuery.ajax

I've got a problem sending a file to a serverside PHP-script using jQuery's ajax-function. It's

avatar
Robt
0 1 0 9
asked 07 September, 2021
56 votes
17 answers
3K views
jQuery Ajax POST example with PHP

I am trying to send data from a form to a database. Here is the form I am using: <form name="foo" action="

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
57 votes
22 answers
1.3K views
Wait until all jQuery Ajax requests are done?

How do I make a function wait until all jQuery Ajax requests are done inside another function? In short, I ne

avatar
Alphonso
0 1 0 9
asked 07 September, 2021
53 votes
21 answers
2.2K views
jQuery Ajax error handling, show custom exception messages

Is there some way I can show custom exception messages as an alert in my jQuery AJAX error message? For examp

avatar
Cortez
0 1 0 9
asked 07 September, 2021
55 votes
26 answers
2.9K views
jQuery Ajax File Upload

Can I use the following jQuery code to perform file upload using POST method of an ajax request ? $.ajax({

avatar
Percy
0 1 0 9
asked 07 September, 2021
63 votes
16 answers
1.9K views
Ajax request returns 200 OK, but an error event is fired instead of success

I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always retu

avatar
Venice
0 1 0 9
asked 07 September, 2021
59 votes
20 answers
2K views
jQuery AJAX submit form

I have a form with name orderproductForm and an undefined number of inputs. I want to do some kind of jQuery.

avatar
Keith
0 1 0 9
asked 07 September, 2021
56 votes
25 answers
1.8K views
Is Safari on iOS 6 caching $.ajax results?

Since the upgrade to iOS 6, we are seeing Safari's web view take the liberty of caching $.ajax calls. Thi

avatar
Luis
0 1 0 9
asked 07 September, 2021
65 votes
5 answers
1.7K views