Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [ajax]

AJAX (Asynchronous JavaScript and XML) is a technique for creating interactive website user interfaces without the traditional web page refresh or reload. It uses asynchronous data exchange between client and server to update displayed information and respond to user interactions seamlessly. Include additional tags for programming languages, libraries, frameworks, web browsers, protocols and other environmental information.

6709 votes
42 answers
2.1m views

How do I return the response from an asynchronous call?

How do I return the response/result from a function foo that makes an asynchronous request? I am trying to return the value from the callback, as well as assigning the result to a local variable ...
Felix Kling's user avatar
4491 votes
8 answers
601k views

Why does Google prepend while(1); to their JSON responses?

Why does Google prepend while(1); to their (private) JSON responses? For example, here's a response while turning a calendar on and off in Google Calendar: while (1); [ ['u', [ ['smsSentFlag', ...
Jess's user avatar
  • 42.8k
3148 votes
34 answers
1.5m views

How can I upload files asynchronously with jQuery?

I would like to upload a file asynchronously with jQuery. $(document).ready(function () { $("#uploadbutton").click(function () { var filename = $("#file").val(); $.ajax({...
Sergio del Amo's user avatar
2174 votes
39 answers
3.6m views

Disable same origin policy in Chrome

Is there any way to disable the Same-origin policy on Google's Chrome browser?
Landon Kuhn's user avatar
  • 77.8k
2160 votes
42 answers
810k views

How do I format a Microsoft JSON date?

I'm taking my first crack at Ajax with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string ...
1999 votes
18 answers
716k views

Abort Ajax requests using jQuery

Is it possible that using jQuery, I cancel/abort an Ajax request that I have not yet received the response from?
lukewm's user avatar
  • 21.7k
1534 votes
34 answers
1.2m views

How to manage a redirect request after a jQuery Ajax call

I'm using $.post() to call a servlet using Ajax and then using the resulting HTML fragment to replace a div element in the user's current page. However, if the session times out, the server sends a ...
Elliot Vargas's user avatar
1508 votes
19 answers
2.1m views

How to manually send HTTP POST requests from Firefox or Chrome browser

I want to test some URLs in a web application I'm working on. For that I would like to manually create HTTP POST requests (meaning I can add whatever parameters I like). Is there any functionality in ...
Pascal Klein's user avatar
  • 24.6k
1328 votes
14 answers
834k views

How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?

I have a JavaScript widget which provides standard extension points. One of them is the beforecreate function. It should return false to prevent an item from being created. I've added an Ajax call ...
Artem Tikhomirov's user avatar
1233 votes
11 answers
931k views

Serializing to JSON in jQuery [duplicate]

I need to serialize an object to JSON. I'm using jQuery. Is there a "standard" way to do this? My specific situation: I have an array defined as shown below: var countries = new Array(); countries[0]...
Herb Caudill's user avatar
  • 49.8k
1101 votes
25 answers
145k 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. This is in the context of a PhoneGap application so it is using the Safari WebView. Our $.ajax ...
user1684978's user avatar
  • 8,569
1091 votes
21 answers
2.6m 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.get or ajax or anything like that that would call a page through Ajax, and send along all ...
Nathan H's user avatar
  • 48.9k
1083 votes
35 answers
1.2m views

Scroll to bottom of div?

I am creating a chat using Ajax requests and I'm trying to get messages div to scroll to the bottom without much luck. I am wrapping everything in this div: #scroll { height:400px; overflow:...
kush's user avatar
  • 16.8k
929 votes
24 answers
882k views

How can I make an AJAX call without jQuery?

How can I make an AJAX call using JavaScript, without using jQuery?
discky's user avatar
  • 15.1k
927 votes
14 answers
460k 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 returns 200 OK, but jQuery executes the error event. I tried a lot of things, but I could not ...
Pankaj Mishra's user avatar

15 30 50 per page
1
2 3 4 5
14798