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.
221,967
questions
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 ...
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', ...
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({...
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?
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?
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 ...
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 ...
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 ...
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]...
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 ...
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 ...
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:...
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?
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 ...