Most voted "ajax" questions
AJAX (Asynchronous Javascript and XML) is a technique for creating interactive websites uniformly through asynchronous data exchange between client and server. AJAX facilitates server communication or partial page updates without a traditional page update.
Learn more…3,397 questions
Sort by count of
-
123
votes9
answers13997
viewsHow to create a website without reloading every click on a link?
I’m looking to develop a site that runs all in the same file, but I’m not sure how to look for study material for this. Thus: Normal site->I’m on the Index.php page. When I click on the…
-
82
votes5
answers86551
viewsUpload a file with AJAX
I wonder if there is any simple way to upload files via AJAX + JSON. If there is, what would it be?
-
66
votes5
answers24456
viewsAJAX request with pure Javascript (no Apis)
Usually, when we need to resort to requisitions AJAX using Javascript, we have handy Apis that help us with this (e.g.: jQuery). However, what would be the safest and cross-browser to make these…
-
40
votes6
answers2300
viewsAJAX is not a programming language. So what is it?
I’m asking this question because I’m tired of seeing things as requirements for a certain programming position: You need to know the languages PHP, Javascript, CSS and AJAX I have learned that AJAX…
-
27
votes3
answers35092
viewsAjax cross-Omain request with pure Javascript (no Apis)
I have two applications in different domains, and I need to make a request Ajax between them saw POST or GET so cross-Domain. What would be the safest way to implement this in Javascript, without…
-
22
votes1
answer3430
viewsIn the new browsers now there will be no more synchronous requests?
I saw it today in mine Google Chrome, updated to the version 40.0.2214.91, a message that said Synchronous Xmlhttprequest on the main thread is deprecated because of its detrimental effects to the…
-
21
votes4
answers7389
viewsHow to make Ajax requests, with Jquery, on different domains?
It is possible to request a POST type to a url that is not part of the domain of our application? $.ajax({ type: "POST", url: "http://www.dominioexterno.com.br/acao/", data: { var1:…
-
21
votes6
answers65532
viewsSum in 2 inputs and appear in real time - Javascript
My question is the following: I have two inputs type text. One person put a number in input 1 and another number in input 2. When the person had just filled in, the result of adding the 2 inputs…
-
21
votes3
answers2168
viewsHow to Make Icone Ride in the Google Maps api
In this My script below it every 30 seconds causes the icone to change position, only the icone disappears and appears at the next point. What I wanted was for him to walk up to the next point as…
-
21
votes2
answers17718
viewsWhat to use in Ajax, Success or done?
Sometimes I see them using success, sometimes I see .done, to process the response obtained in the request. Which one should I use? Is there any difference between the two? Which? The same thing for…
-
20
votes3
answers20650
viewsWhen to use Success: Function() and . done(Function()) in asynchronous requests?
Simply put, I can write an asynchronous request like: $.ajax({ url: url, dataType: 'json', type: 'GET', success: function (_user){ alert (_user) } }); that alerts me to the return _user. Likewise, I…
-
16
votes5
answers7129
viewsNumber of weeks in a month
I would like to know how to calculate the number of weeks you have a month D S T Q Q S S 1 => Semana 1 2 3 4 5 6 7 8 => Semana 2 9 10 11 12 13 14 15 => Semana 3 16 17 18 19 20 21 22 =>…
-
16
votes4
answers3142
views -
15
votes4
answers6633
viewsHow to make the browser "Back" button work on an AJAX site?
I researched this topic a year ago when I made a site with features like $.load() and $.ajax() in AJAX/jQuery but did not get anything satisfactory that was not overly complex, and until today the…
-
15
votes1
answer5948
viewsWhat is Long Polling?
Whenever I search for "periodic updates" and "real-time notifications" for web applications, I come across the term long Polling. From what I understand, it seems to refer to periodic updates made…
-
14
votes3
answers24198
viewsWait for Ajax return in synchronous function
I have an operation that I need to perform synchronously, but part of the information I need can only be obtained via Ajax. I tried to synchronise everything with a wait for Ajax to return. The…
-
14
votes3
answers823
viewsCan I have Javascript write PHP?
I can do the javascript write down php? Related: I can write in Javascript inside PHP? I can write ajax and javascript together?…
-
14
votes0
answers398
viewsHow to make ajax calls through reverse proxy in elegant way?
I have a project that validates, in Javascript, the structure of a JSON. Here is more or less the structure I had used to rescue the structure asynchronously, as well as what would be the static…
-
13
votes2
answers1997
viewsHow to detect Ajax Request?
Is there any way in PHP to detect if the request made is Ajax?
-
11
votes3
answers14892
viewsfunction $.Ajax() return value?
that is the code: var res = VerFileRepetidoBancoAjax( "teste" ); console.log("res="+res); function VerFileRepetidoBancoAjax( str ){ $.ajax({ url: "caminho.", type: "get", dataType:"json", data:…
-
11
votes1
answer1662
viewsError sending Upload with Ajax
I am trying to send a file via Upload to a certain folder but I am not able to do and not understanding the error being accused by the script, I will try to be as clear as possible in the…
-
11
votes2
answers1641
viewsWhen to use and not use AJAX when submitting forms?
If I have a giant form of questions, sending via AJAX is the best way? <form id="formulario" method="POST"> <!--vários Questionarios aqui--> </form> Javascript: $.ajax({ type:…
-
10
votes2
answers10588
viewsSend image by selecting it and show thumbnail without refreshing the page
How do I code to send an image when selecting it during registration? And after sent appear in the form a thumbnail, so the user continue filling the rest of the form. Similar to what is done in…
-
10
votes4
answers17125
viewsnet error::ERR_BLOCKED_BY_CLIENT when making Ajax request
I came across a strange error when I tried to execute an ajax request, and I was not very successful in finding solutions. That is the error: The line 199 of forms.js is the $.ajax({ in: $.ajax({…
-
10
votes1
answer1380
viewsIs it good practice not to close the . php file with ? > after an XHR call made from a . html file?
Should I close the PHP tag <?php with the ?>? A friend with more experience recommended me not to close saying that it was a "good programming practice", I never understood why, but I follow…
-
10
votes2
answers1172
viewsBlock unwanted AJAX calls
I did a test on Google Plus, turned on Firebug and inserted a post. When parsing Firebug I recovered the URL it was executed via AJAX. I copied the URL and ran it in the browser with the active…
-
10
votes2
answers4210
viewshow to represent a monetary field with semicolons in javascript jquery
I’m having a huge doubt. I need to take the values that are in the database with decimals of 3 (for example: 56826.497) and show on the screen the value 56.826,497. I’ve tried using the maskMoney…
-
10
votes5
answers17262
viewsHow to use ajax and php to call a function in php?
I’m having difficulty requesting a PHP function via Ajax AJAX code: $.ajax({ url: 'geraSenhaProvisoria.php', type: 'POST', cache: false, data: {geraSenha(6, true, true, true)}, error: function() {…
-
10
votes4
answers1951
viewsUpload with Ajax and formData does not send data
I have a problem and I can not solve, I’m trying to upload via ajax and php, I already got some tips here by SO, But I’m still in trouble, and I know the big chance that I’m doing something stupid…
-
9
votes1
answer391
viewsInterruption of an asynchronous request
What happens when the user, for example, reloads the page with an asynchronous request in progress? Does the server continue to run the script? And how can I interrupt an ongoing request via JS?…
-
9
votes2
answers16374
viewsWhat is the difference between Ajax dataTypes in jQuery?
I am learning jQuery and I need to know the difference between Ajax dateTypes. dataType: "xml" dataType: "json" dataType: "script" dataType: "html" How this influences the execution of the script…
-
9
votes2
answers878
viewsHow to create a unique method to handle errors with ajax
I have a web application that performs several calls ajax. My college professor challenged me to create a generic message and combine the whole error treatment into a single function. Someone could…
-
9
votes2
answers181
viewsDo not ask for credentials if user is not authenticated
I have a system with two sites in the same domain. The two sites are in separate folders of the same domain, more or less like this: http://renan/foo http://renan/bar The first site (let’s call it…
-
9
votes3
answers2808
viewsHow to block Adblock?
I’m setting up a site that works with ads and so I can’t allow a user to log in with Adblock, I tried using the www.antiblock.org script but it only works on one page, on another page where I work…
-
9
votes2
answers48118
viewsLoad a tab into a div
I am developing an HTML page for mobile and I have the following question: is it possible to load one page inside another? For example: pagina.html: <div class="container22"> <div…
-
9
votes5
answers1956
viewsDifference between JSON and String data
I’m just finishing building a website on PHP with architecture MVC, the next step is to integrate the application (I only have the interface) with the core(controller) site, to fetch information…
-
9
votes1
answer189
viewsWhy is the incrementer "lost" in the loop?
Making a simple loop FOR, I found a strange behavior that I couldn’t understand. The count is "lost" in the AJAX request, keeping the value of the incrementer with the last one. The request to the…
-
9
votes9
answers12142
viewsSearch via ajax during input text ( autocomplete )
I did a search using ajax that when clicking a button triggers a request with the term searched and returns with data that fills a combobox html (select). So far so good. However, I found it…
-
8
votes1
answer506
viewsHow do I catch the current percentage of a download?
I want to get the value of the percentage of an ajax request on an external server. How to do? $("#uptade_space_disk").click(function(){ var url = "/calcular-espaco-em-disco" jQuery.ajax({ url: url,…
-
8
votes2
answers198
viewsWhat main precautions should I keep in mind for my application to work properly in different browsers?
I program small systems using xhtml, ajax and php. When I mount the code I test the parts in Chrome developer tool (Ctr+I) and in phptester.net. When I finish my application I have to debug…
-
8
votes3
answers1513
viewsIs there an application security flaw when using AJAX?
I am a programmer HTML/CSS/PHP a few years and by incredible and more impossible it seems, I’m just entering the world of Javascript with jQuery and AJAX now. My question is whether the security…
-
8
votes4
answers542
viewsSubsequent Calls in Ajax
I wrote a system in Web2py for a client, and he wants me to automate a procedure. I thought of using Ajax. The idea is the following: I have a list of companies. Let’s say, 50. I want the screen to…
-
8
votes2
answers3046
viewsjQuery validate submitHandler does not work on firefox
With the following function below, I can send the data via ajax quietly in Chrome, but when testing in Firefox, no error occurs and the data is not sent. $('#form_lista_amiga').validate({ rules : {…
-
8
votes1
answer1129
viewsLong Polling performance with PHP, Mysql and Ajax
I’m developing a site in PHP, and using Long Polling techniques for real-time notifications. I’m making the script wait 50 seconds for an answer, and not getting one, in 2 seconds it comes back to…
-
8
votes3
answers1766
viewsAjax cross Domain
Hello a while ago I asked this question: Grab content from another page by javascript or jquery Fellow @Sneepsninja made the following algorithm that worked. $(document).ready(function(){…
-
8
votes3
answers5803
viewsDifference between $.ajax(), $.get() and $.load()?
What’s the difference between $.ajax(), $.get() and $.load()? Which is the best to use and under which conditions?
-
8
votes1
answer594
viewsWhat is PJAX and how to detect a PJAX call in the back end?
I’ve been reading about PJAX, but it is a little confusing its operation independent of frameworks, I saw articles but all turned to YUI or plugins for jQuery, really it was not very clear its…
-
8
votes1
answer1840
viewsHow to implement editable table by updating the fields in the database automatically
I have the following table that lets edit directly in cells: The codes are in 4 parts: Mysql table CREATE TABLE IF NOT EXISTS `php_interview_questions` ( `id` int(8) NOT NULL, `question` text NOT…
-
7
votes3
answers7402
viewsLoad refresh-free page post with AJAX and JQUERY
I am in need of a Wordpress help as I would like to load posts without refresh or reload page. I have a menu that returns posts from a certain category in a <div> left and would like to be…
-
7
votes1
answer950
viewsIntercept AJAX requests
I have the following doubt, as I can do to "intercept" AJAX requests before that they be made? For example, in some forums while constantly browsing requests are being made without our knowledge,…