All Questions

3618
votes
25answers
941895 views

How do I return the response from an asynchronous call?

I have a function foo that makes an Ajax request. How can I return the response from foo? I tried to return the value from the success callback as well as assigning the response to a local variable i...
150
votes
11answers
481159 views

Ways to circumvent the same-origin policy

The same origin policy I wanted to make a community wiki regarding HTML/JS same-origin policies to hopefully help anyone searching for this topic. This is one of the most searched-for topics on SO an...
2447
votes
25answers
1134143 views

How can I upload files asynchronously?

I would like to upload a file asynchronously with jQuery. This is my HTML: <span>File</span> <input type="file" id="file" name="file" size="10"/> <input id="uploadbutton" type="b...
270
votes
7answers
245173 views

How to use Servlets and Ajax?

I'm very new to web apps and Servlets and I have the following question: Whenever I print something inside the servlet and call it by the webbrowser, it returns a new page containing that text. Is th...
518
votes
11answers
1028528 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="form.php" method="POST" id="foo"> <label for="bar">A bar</label> &l...
545
votes
20answers
954092 views

jQuery Ajax File Upload

Can I use the following jQuery code to perform file upload using post method of an Ajax request ? $.ajax({ type: "POST", timeout: 50000, url: url, data: dataString, success: funct...
908
votes
23answers
978788 views

Disable same origin policy in Chrome

Is there a way to disable the same origin policy on Google's Chrome browser? This is strictly for development, not production, use.
408
votes
13answers
591590 views

jQuery AJAX cross domain

Here are two pages, test.php and testserver.php. test.php <script src="scripts/jq.js" type="text/javascript"></script> <script> $(function() { $.ajax({url:"testserver.p...
34
votes
2answers
21993 views

How to append whole set of model to formdata and obtain it in MVC

How do I pass a whole set model object through formdata and convert it to model type in the controller? Below is what I've tried! JavaScript part: model = { EventFromDate: fromDate, ...
1554
votes
17answers
467431 views

Abort Ajax requests using jQuery

Using jQuery, how can I cancel/abort an Ajax request that I have not yet received the response from?

Previous Next