Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ajax]

AJAX (Asynchronous Javascript And XML) is a popular technique for creating interactive websites.

2
votes
1answer
24 views

An approach to send the contents of a file on the server to the client in real-time

I have a relatively simple front in good ol' JQuery, that makes a POST Request to a Flask Python web server, that runs a Python script using the subprocess module. Here's the whole route for ...
2
votes
1answer
100 views

Resolving request congestion at browser by using socket as “fast lane”, any consequence?

I have received multiple reports from users of a Web-based GIS application we have rolled out one to two year ago, complaining the application becomes unstable/unresponsive. After a brief ...
0
votes
1answer
440 views

PHP MVC controllers using ajax

I'm learning to use the MVC pattern to design my PHP's software. I always use ajax to send requests to my controllers so often I've a code structure like this: <?php if(isset($_POST['action']) &...
0
votes
2answers
270 views

WebSockets vs Ajax call for scheduled event?

Intro I have been weighing the pros and cons of using WebSockets vs. an Ajax call for an event which will happen every x number of seconds (in this case 5). I'll start by explaining the scenario. ...
1
vote
1answer
361 views

Chat application - write to file and then save in database

I have followed this approach that is described here to implement a simple chat application: https://code.tutsplus.com/tutorials/how-to-create-a-simple-web-based-chat-application--net-5931 I'm ...
0
votes
1answer
106 views

Advantages/Disadvantages disallowing non ajax login requests

On the project I'm working on, I noticed that on login there is a check in backend which checks if the request is an ajax reques (checks 'X-Requested-With: XMLHttpRequest') or not. If the request is ...
-4
votes
1answer
458 views

What happens if multiple users send http requests to the server concurrently? [closed]

So basically, it is a web server that is hosting a php project. The project accepts some inputs from the users and send them to the server via ajax for validation each time the check button is clicked....
2
votes
4answers
325 views

JavaScript only validation on AJAX form submit

I've been mulling this question over for a few days in my head and I can't come to a solid answer. We understand that client side validation for forms is not enough, because you can easily turn ...
1
vote
1answer
761 views

PHP Post vs JavaScript Ajax Request

I have been into web development with both client amd server side code, and have been using JavaScript Ajaxto receive and manipulate for data along with PHP scripts. However, I noticed that ...
5
votes
2answers
235 views

Better to send all data to client or query server for every search?

I have a search function on my site that needs to search through ~2000 items (this table never changes, it will always have the same number of items) stored in MySQL. All it needs to do is search by ...
-2
votes
1answer
55 views

Single Page Apps: handling state dependencies

If I have an React/Redux single page application that has - say - a customers page that lists businesses that are customers, and from there each customer can be accessed with a URL like this: /...
3
votes
2answers
57 views

Ajax response — is there an agreement on the structure?

Say, I make an ajax request to a server from a page, something like "show more articles". Is there a common agreement on the format or rather structure in which a result should be returned? Something ...
0
votes
2answers
596 views

Is there an advantage to using AJAX rather than a simple window.location?

When doing simple server updates or submitting forms or that type of thing, I have come to a fork in the road...using AJAX: var ajax = new XMLHttpRequest(); ajax.open("post", "myserver.php", true); ...
0
votes
1answer
56 views

Bad practice to use table column names as keys in JS when making XHR requests?

Is it OK to use table column names as keys in a key/val pair on the JS side when making XHR/AJAX requests? In JS, I'll do something like this, where I specify the data to insert into the table, using ...
0
votes
1answer
3k views

Single page app vs multi page application?

My experience has been using the hybrid approach per use case demand: Where content on same page needs to be updated, we used AJAX/SPA approach But when the page has a completely different layout/...
75
votes
12answers
21k views

What's actually wrong with an endpoint returning HTML rather than JSON data?

When I first started learning PHP (about 5 or 6 years ago) I learned about Ajax, and I went through "the phases": Your server returns HTML data and you put it inside a DOM's innerHTML You learn about ...
3
votes
1answer
145 views

Performance of frequent AJAX requests sent for database queries

I have JavaScript object which is converted to JSON and sent every time the user changes some filter for the search (for example, after he clicks the button or select/unselect item in the list). Data ...
1
vote
1answer
76 views

What are approaches for building more robust Ajax applications without using AngularJS

Within a Java shop, we are using Spring MVC, some HTML output and some JSON/Rest output as a service. Our client side is more familiar with jQuery for ajax messaging to the server. We have been able ...
1
vote
0answers
78 views

When virtual scrolling/pagination meets incremental search

I am developing an AngularJS app, and the server side PHP, step by step, implementing features and then polishing them. I currently periodically request data from the server, of the order of a few ...
0
votes
1answer
888 views

making http request by ajax or c#

In my web application I need to get data from Wikidata, for example to show item's details. I thought about using ajax for this, but was't sure from where I should to call it, so I asked this question....
-1
votes
1answer
2k views

If I want to implement ajax, does the choice of the web server make a difference?

I have been spending quite a lot of time trying to decide if I should use apache** or nginx. I am very biased towards nginx due to the simple configuration, better scalability and it just feels more ...
1
vote
1answer
1k views

sending ajax request with setinterval . is it good?

I am developing a website where client needs that any notification should reach as soon as it is created. so i am using setinterval function of jquery and using ajax requests to get the notifications. ...
3
votes
2answers
541 views

How to validate ajax request comes from correct page and is not tampered with?

I am building a simple Q&A app with PHP, HTML and JS. I have three tables: users,question and answers, each table has it's own primary key and questions and answers both have foreign key ...
1
vote
0answers
533 views

Spring MVC - Handling validation errors using the jQuery Validation plugin

Using jQuery validation, I send an AJAX request which is handled by the controller. The controller does send a response, but jQuery fails to insert the respective error message into the DOM. Instead, ...
1
vote
1answer
2k views

HTTPS site perform ajax calls to native http desktop aplication

I'm working on web app that communicates with a locally installed desktop application to get certificate information from the user machine and perform digital signatures. Currently it's possible to ...
3
votes
2answers
2k views

Managing session timeouts with regards to user activity in the page

So I will be creating a feature to a php application that does the following: Create a session that expires after 30 minutes. After 30 minutes, if there is no user activity in the application (...
1
vote
0answers
40 views

Google Analytics Experiments with Ajax

This is a cross post from https://stackoverflow.com/questions/40544132/google-analytics-experiments-with-ajax. I though it is better to dicuss it here. I would like to integrate google analytics ...
0
votes
2answers
1k views

Video streaming through Ajax calls

These days I have seen couple of sites (including Youtube) that stream videos through Ajax calls (XHR) in few MBs or even less than MB. For an example of what I said see the highlighted lines in the ...
4
votes
2answers
1k views

Spring MVC - Handling validation errors using AJAX

I'm new to Spring MVC, hence the question may appear trivial. I have a login form which is submitted via ajax and in return I receive a ModelAndView (displaying existing list of contacts of the user) ...
1
vote
0answers
76 views

AJAX request vs redirection during long API calls

Let's consider this scenario, I have a form, I need to post this to the backend and use data from this form to perform multiple webservice API calls. These API calls could be payment processing calls ...
1
vote
0answers
368 views

Will comet long polling slow down the system performance regardless of the server it's hosted on?

I apply comet long polling which uses usleep inside while loop until no new data returned by server like below: PHP while ($currentmodif <= $lastmodif) { usleep(10000); /...
1
vote
0answers
72 views

Website that only loads content on modal windows (ajax)

I'm working with a client that only loves Wordpress, so I have to create a theme. The idea of my client is to have an interactive background (meaning there's no other content but the background, the ...
1
vote
2answers
97 views

Review page use of AJAX

I am currently working on a site that heavily uses AJAX. I have a page that when called renders the basic HTML and then uses AJAX to get the data that the pages needs and then renders the rest of the ...
1
vote
2answers
486 views

Is it safe to say that AJAX is a particular way of using HTTP?

I really need someone to confirm the following, and if necessary help me filter what I have read so far. AJAX, which stands for Asynchronous JavaScript and XML, is used to exchange data and is a form ...
-2
votes
2answers
138 views

Is using AJAX worth it in the inner administrative system? [closed]

Imagine we have a administrative system that is designed to be as fast and lean as possible, without too much fancy CSS or JS. The UE is not that great, but still it is pleasing on the eyes and gets ...
0
votes
1answer
300 views

How to display recent post on website and make own search engine ? With PHP

On OLX like Website , Anytime a user posts a new ad. It comes in top of the page. No search is involved in it. Which technology we can use to make such functions. Suppose X is visiting my website ...
1
vote
1answer
485 views

Client wants browser's back button to work on a website doing AJAX calls

I'm currently working with a client's website in which we are using ajax calls to show the content of the pages, we are doing this in a single div and obviously you don't move from the index. My ...
2
votes
2answers
1k views

Image resizing client side vs server side

When uploading a lot of images to a server, to minimize the space taken by the images, is it better to resize the images before sending to the server or upon receiving them? It seems to me that ...
-1
votes
2answers
289 views

React.js + Flux, immediate response during history back/forward

In Instagram (web), when you click back/forward arrows - I've noticed that the content isn't loaded from the server and it immediately show up. After reading the docs on react.js + flux, I had this ...
12
votes
1answer
9k views

RESTful HTTP and websocket in the same application?

If an application has already an opened WebSocket for live feeds, should I use it over AJAX for the other communications with the server? Because the connection is already opened, should we use it ...
1
vote
1answer
64 views

Caching and Website performance on IOS VS PC

I have a website that pulls from a database to display images/names/misc info. The pages are used on both IOS Devices (iphones,ipads,ipods so far) and on PCs using internet explorer and Safari/Chrome ...
1
vote
1answer
199 views

What is the approach for implementing FLUX in a CRUD application that pulls JSON data from the server?

While using FLUX in a CRUD application, according to what I understood, initially the data is returned from an AJAX call and then stored in the STORE. So, all the data that is currently viewed is only ...
1
vote
0answers
609 views

Web browser resetting connection

I have a web application that is hosted on an embedded device. This device has its own basic web server that can serve content just like any other web server. The web application in question is ...
2
votes
1answer
839 views

Building a real-time web-app with Ajax .post()

Usually, real-time web-apps are built with websockets, right? Well, let me be radical here - what if I used Ajax? Okay, okay, I know it has its limitations. You can't build Agar.io, sending data ...
0
votes
3answers
69 views

Do and Undo action in the same / different page - Is there a difference?

If I'm bulding an application like a social network and I implement a like / favorite button with AJAX, is it preferable to use one URL to like / dislike or 2 differents URL? If I use one, for ...
9
votes
1answer
6k views

Many asynchronous calls vs single call to the API

We are developing a REST API which among others is going to be consumed by an HTML5 frontend via javascript. The application is for use within the organization and usually has about 300 users, but we ...
0
votes
1answer
196 views

Can I use an external Mustache template without Ajax?

I wrote up a site using Mustache to template it. Right now though, the template is embedded in the page, which defeats the purpose of using the template since I'll need to copy it to any other pages ...
1
vote
1answer
424 views

What are the impact to the server when using ajax polling for live web pages?

I've been searching on the internet about using interval ajax polling for live web pages and I've been using it along with SignalR. Now I always read an article online about using ajax polling for ...
2
votes
1answer
12k views

Rendering partial View in MVC

i am not so familiar working with partial Views. The reason behind that is that I really do not have the basics of Jquery/JS/Ajax. But I recently found through some SO post that a partial view can be ...
0
votes
0answers
104 views

Managing pagination or cursor with deleting items in the list

I have a REST API that could GET, POST, PUT, DELETE models. My problem is when I paginate that with ajax call combining with DELETE operations. My problem comes after few steps list one page list ...