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
-
7
votes1
answer4635
viewsHow to recover query result variables via Ajax in PHP?
I made an appointment via Ajax that returned me the variables within the PHP: // Variaveis $nome = $Fetchi['nome']; $email = $Fetchi['email']; $tipo = $Fetchi['tipo']; $senha = "Digite uma nova…
-
7
votes3
answers367
viewsjQuery - Typical duplicate use situation of the same code. How to proceed?
Being here doing my sites on php/mysql/html/css and learning more and more about jQuery I found myself in the situation where I should use the same code for two ids distinct. How to proceed when you…
-
7
votes1
answer1542
viewsUpload image data via ajax
<script type="text/javascript"> $(function(){ $("#oformulario").submit(function(e){ e.preventDefault(); var nome = $("#nome").val(); var email = $("#email").val(); var obs = $("#obs").val();…
-
7
votes1
answer751
viewsIs it possible to add Origin in the Header of a redirect according to the HTTP protocol?
I am implementing an application where I need to perform a redirect from one server to another and am encountering problems. While performing a redirect, receive the following error message:…
-
7
votes2
answers11472
viewsJust grab a div from another page via jQuery
Grab content from another page by javascript or jquery On another question I wanted to know how to get content from a page. In this I wanted through this code to catch only one <div> instead…
-
7
votes1
answer393
viewsAjax function does not pass the Success
My function calling my web service var email = document.getElementById("email").value var senha = document.getElementById("senha").value $.ajax({ url:…
-
7
votes4
answers16671
viewsSynchronous Xmlhttprequest error on the main thread is deprecated
When I use this code in my file, an error occurs in the log, and ends up giving problems in other javascript calls. Current page file (the problem javascript is at the end): <html>…
-
7
votes3
answers1977
viewsHow to attach events to dynamically created elements and pass parameters?
I have a table that is generated via ajax and a certain column generates a link. As it has been implemented, currently, it writes a code html with javascript intrusive. Something like below: return…
-
7
votes1
answer293
viewsHow do I prevent caching Ajax requests in IE 6?
I have the code below, to update a DIV on a page: var req; // FUNÇÃO BUSCA ROMANEIOS PARA EXIBIR NA TELA DE MENU. function buscarRomaneio() { // Verificando Browser if(window.XMLHttpRequest) { req =…
-
7
votes4
answers5024
viewsHow to disable field with Javascript?
I own these HTML fields: <div class="col-sm-6"> <input asp-for="ConfiguracaoTecnibra.HabilitaTeclado" type="checkbox" id="cbHabilitarTeclado" onclick="HTeclado();" /> <label…
-
7
votes1
answer325
viewsHow to read a JSON file to render HTML list
I am having a difficulty in an application that reads a json file and renders in HTML, I am not able to access the object correctly, the variable products is as Undefined. Could someone help me? if…
-
6
votes2
answers3548
views -
6
votes1
answer2022
viewsHow to pass values of an Ajax request to Google Chart?
I started messing with Google Chart today, and I can make the chart by putting the values in hand outside the requisicao ajax. Only that my application needs this data coming from a database and I’m…
-
6
votes1
answer1270
viewsIs it safe to use ajax requests over and over again?
I want to create a 'mini server' to use on my site (tumblr), for real communication with my visitors and one way to do this is by using ajax requests. When the site loads, it requests a JSON file,…
-
6
votes1
answer2385
viewsLoad content dynamically with AJAX
I have the following HTML code: <label id="meuTemplate" for="criaAssoc" class="instAssoc" style="display:none"> <strong>ID:</strong> <input name="idInstrucao" type="text">…
-
6
votes4
answers7584
viewsHow to use AJAX with Laravel?
I have a select that when I change its value it should reorder a list, e.g.: by id, name, etc. without Laravel I would use a function onchange and pass the sorting pattern to a PHP page that would…
-
6
votes4
answers9080
viewsSelect2 with AJAX
For some reason my Select2 using AJAX to fill it is not working. When I put a Debugger in the code, it does not enter the method result: and also returns no error. HTML: <input type="hidden"…
-
6
votes2
answers1104
viewsWhat is the best way to upload files with Ajax?
I could take a code on the Internet paste here and try an answer but I prefer that help me with the logic and programming of a script to upload images in Ajax. I don’t know how to start, I’m a…
-
6
votes2
answers1160
viewsHow to access JSON values from ajax in a PHP page?
I passed via ajax those values: $.ajax({ url: '/loterias/cadastro.php', type: "POST", data: "{'numeros': '" + numeros + "', 'jogo':'" + jogo + "'}", dataType: 'application/json; charset=utf-8',…
-
6
votes3
answers2852
viewsHow to force a download with ajax?
I am using PHP’s DOMPDF class to generate reports of accounts receivable with dynamic filters. The user selects the filters in a form and asks to generate, so far so good. But he will have the…
-
6
votes3
answers3565
viewsUse ajax with Actionlink
I want to change the ActionLink and the URL to work with Ajax, but I don’t know how to do it. Follow my code with ActionLink and URL. <ul class="nav" id="side-menu"> <li> <a…
-
6
votes2
answers14096
viewsHow to display echo quotes in PHP?
I am developing an application that uses PHP + AJAX and I came across an annoying problem. AJAX only recognizes the function if it is like this: onclick="remover_musica_ftp('0','Deposito de bebida'…
-
6
votes2
answers4741
viewsHow to read a JSON file without a server?
I’m developing a simple static website with html, css, and javascript hosted in Dropbox, using javascript with framework Jquery and trying to read a JSON file. var jqxhr = $.getJSON( "example.json",…
-
6
votes1
answer954
viewsSend data in json format to php
I know it is fully feasible to send PHP json to JS, but it is possible to send my data via ajax in json format to PHP?
-
6
votes6
answers10935
viewsHow to receive a JSON object from an external url/domain?
I found a Lottery API that brings me the data of the result of a Lotofácil draw, but I am not able to access the data of the JSON object. I’m trying this way: $(document).ready(function(){ $.get(…
-
6
votes1
answer378
views -
6
votes1
answer385
viewsProblem with long Polling
Well I did one here script to fetch information from real-time posts the database but it works if I add it directly in Mysql works well but the page when I go to insert a text does not work with…
-
6
votes2
answers374
viewsWhat’s the difference between SSE and Ajax?
I’m looking to update a div which contains a customer’s credits, so update in the Bank the amount of his credits and I am using the setInterval: setInterval(function(){ ver_creditos(); }, 60000);…
-
6
votes1
answer728
viewsAjax in different project
I have a project in Asp.Net MVC with the following method: public ActionResult ObterCursos() { List<curso> cursos = new List<curso>(); curso curso_ = new curso(); curso_.Nome =…
-
6
votes2
answers8910
viewsPopulating selects of cities and states with AJAX (PHP and jQuery Mobile)
I’m riding a webapp with the Jquery Mobile, PHP and AJAX framework. In this app I have a form with selects of ESTADO and CIDADE, was made an AJAX that when selects the ESTADO, carries the CIDADES…
-
6
votes1
answer93
viewsWhat are the main types accepted by the Fetch API for the HTTP request body?
I know I can use the API fetch to perform HTTP requests by browser. And I know I can use the property body to configure the body of the request. But I would like to better understand which types I…
-
6
votes2
answers1168
viewsUnable to call the same variable outside of Function
I’m having trouble calling my variable pt1 outside the function(data) and within the function getImageItem. Whereas the function(data) is inside the function getImageItem. function getImageItem() {…
-
6
votes2
answers946
viewsAJAX Javascript Pure Asynchronous
I am trying to recover a data coming from Ajax to use in another function, but I am not succeeding. In jQuery I do this using a parameter called async: false. But in pure JS I am not able to do. The…
-
6
votes2
answers4340
viewsSend checkbox with ajax jquery php
I have the form to send/work perfectly with the other fields, but I cannot receive the checkbox selections. I need help to receive/manipulate in php: THE HTML: <div class="input-group">…
-
6
votes2
answers769
viewsGeolocation + Ajax + PHP - what am I doing wrong?
<body> <script type='text/javascript'> var lati = ''; var long = ''; var cidade = ''; var estado = ''; var pais = ''; var dadosajax = '';…
-
6
votes3
answers1530
viewsSend file and text via jquery Asp.net mvc
Guys I managed to send the file through this code: var jqXHRData = null; $(function () { $('.progress').progress({ percent: 0 }); $("#divUpload").on('click', function () {…
-
6
votes1
answer577
viewsProblem with jquery-ui autocomplete via Ajax/PHP
Talk to the guys! I’m doing an application that recovers cities from a SOAP webservice, my application is already all ok, with queries, however I’m trying to implement now an autocomplete, and I’ve…
-
6
votes1
answer1495
viewsAjax running Controller (MVC, PHP)
I just started to give a studied in mvc, and I have a question. How to make my ajax execute certain method of my controller. obs. I’m not using any framework, below is the code. View <div…
-
6
votes1
answer80
viewsDoubt about $.post and $.ajax behavior
I’ve always been used to using $.ajax() for all my requests of the type, and this works perfectly. An example that is even occurring now is the following: $.ajax({ type: "POST", url:…
-
6
votes2
answers978
viewsCheck if user name is unique in real time
Hey there, you guys! Currently, to check if a username is unique, I do it in the most basic way. Sending the POST to a PHP page that checks in Mysql, only then returns the error. php.: <form…
-
6
votes3
answers965
viewsList JSON data with Javascript
I’m trying to list the data of a JSON through Javascript, but it only presents in the list a position 0. Below follows the JSON: [ { "id":"23" }, { "id":"24" } ] I have the following code below…
-
5
votes1
answer2128
viewsJSON transfer to Codeigniter via AJAX
I’m not able to pass a string in the format JSON for a controller of Codeigniter via AJAX. A string JSON: var avaliacao= {"avaliacao":[{"pergunta":"Qual sua…
-
5
votes1
answer772
viewsWhat does the crossDomain:false parameter in Ajax mean?
I’m implementing an image upload web application on Ajax and there is the parameter crossDomain:false in an example finding. What is the function of this parameter?
-
5
votes4
answers3838
viewsHow to run a PHP function in the background?
I’m using the cPanel API to add dynamically parked domains. So far so good, send the required data via jQuery.post() only that this process takes a little to be completed, about 1 minute. Have some…
-
5
votes1
answer436
viewsProblem with ajax loading with Cakephp 2.x
My pages are uploaded via ajax and uploaded within div content. Where I take the url by the onclick event from the link, and then upload it. Calls made directly from the menu work normally, but when…
-
5
votes2
answers356
viewsIs it possible to apply push technology?
I have a system, in which it displays database files, in list form. I do the query in the database every 5 seconds to see if there are new files, and if you have it is shown to the user using AJAX.…
-
5
votes2
answers8876
viewsAccents and Special Characters in Ajax jQuery
I have a query that is made with Ajax request via jQuery. In the fields when I type a character like "ç" and send the request to the server, it is arriving with the character in another format. Ex:…
-
5
votes2
answers4683
viewsAJAX post request with Angularjs
Hello, I wanted to know how I make a requisition POST for a url with Angularjs and also wanted to know how I transform a normal javascript object for a json, to send in this request.…
-
5
votes1
answer733
viewsHow to send and process N separate forms with ajax without refreshing the page?
How to do when you have N forms with same ID, or CLASS send the data (Submit) process and when finished processing change the color of the <'tr bgcolor="#FFFF00"'> for green '#00FF00'…
-
5
votes1
answer147
viewsHow ajax does to identify classes
I have the following application: function atualizarPrdutos(categoria){ $.ajax({ type: "POST", url: "teste.aspx/InsertData", data: JSON.stringify({categoria:categoria }), contentType:…