Questions tagged [ajax]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

ASP.NET Core - Using Partial Views inside a Modal window for my Add/Edit/View Details screens?

I've been developing .NET projects for the past 3 years, and on my recent web .NET projects, I've been using Partial Views for all the screens that contain Forms for Add/Update/Delete or other ...
hds's user avatar
  • 1
0 votes
1 answer
357 views

Websockets vs Ajax for live search

For building a simplistic live search system, I trying to decide whether to use Websockets or Ajax. Implementation wise, for every letter the user types (or maybe every 0.5 seconds), a database query ...
ahron's user avatar
  • 165
1 vote
1 answer
67 views

How could I optimize an AJAX-based site by avoiding unnecessary/duplicate file-reads for each AJAX call?

I'm an IT guy (read: not a professional programmer) and have made an internal monitoring webtool which allows users to search for printers on our print servers. Based on the filtering criteria given, ...
mmseng's user avatar
  • 121
-1 votes
2 answers
83 views

How to GET multiple values from a database while keeping the request asynchronous?

This is a very small-scale project that I am coding myself, so I am able to build all of the resources however I like. I've done research on this site for help on this issue and can't find anything ...
Guy's user avatar
  • 117
-4 votes
3 answers
2k views

REST API design: Best practice for POST to create an object to a list

I have an API that return list of Employee. This API will have an offset and limit for pagination purpose. On the frontend, I use Single-Page Framework (Vue/Angular/React..). This SPA have a Employee ...
flemadap's user avatar
  • 111
2 votes
2 answers
108 views

Server-side script to handle many near-simultaneous incoming XMLHttpRequests

I am building my own analytics platform, which I want to work like this... A JS script in each of my webpages collects data about users' clicking behaviours and sends that data to a PHP (or other ...
Steve_P's user avatar
  • 31
-1 votes
1 answer
265 views

What sort of data limit would make sense for pulling down all data vs autocomplete/pagination via ajax?

Imagine a page with an autocomplete textbox on it, to get Customer. I am wondering what sort of limit for record size makes sense in this day and age regarding whether all the customers should be ...
NibblyPig's user avatar
  • 3,005
2 votes
1 answer
2k views

Handling an empty path variable request

I have a scenario where I can take a student Id as input via a part variable and return some data back as JSON objects where JavaScript handles the response as a part of AJAX call. Suppose the method ...
user1369975's user avatar
  • 1,279
2 votes
1 answer
60 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 ...
Ericson Willians's user avatar
2 votes
1 answer
422 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 ...
Incognitoo's user avatar
0 votes
1 answer
3k 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']) &...
user9741470's user avatar
1 vote
2 answers
1k 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. ...
nullReference's user avatar
1 vote
1 answer
1k 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 ...
Bryan's user avatar
  • 119
0 votes
1 answer
192 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 ...
haraki's user avatar
  • 3
-4 votes
1 answer
3k 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....
csandreas1's user avatar
2 votes
4 answers
862 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 ...
Adam McGurk's user avatar
1 vote
1 answer
2k 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 ...
Mrigank Pawagi's user avatar
5 votes
2 answers
1k 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 ...
obl's user avatar
  • 159
-2 votes
1 answer
65 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: /...
Rob Grant's user avatar
3 votes
2 answers
150 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 ...
Koodi's user avatar
  • 39
0 votes
2 answers
2k 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); ...
Adam McGurk's user avatar
0 votes
1 answer
296 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 ...
Freddie's user avatar
  • 101
0 votes
1 answer
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/...
user3222249's user avatar
83 votes
12 answers
55k 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 ...
Christopher Francisco's user avatar
2 votes
1 answer
215 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 ...
Nikola Stojaković's user avatar
1 vote
1 answer
120 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 ...
berlinbrown2's user avatar
1 vote
0 answers
106 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 ...
Mawg says reinstate Monica's user avatar
0 votes
1 answer
1k 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....
Alexan's user avatar
  • 249
-1 votes
1 answer
3k 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 ...
akgren_soar's user avatar
1 vote
1 answer
4k 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. ...
Prabhjot Singh's user avatar
4 votes
2 answers
1k 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 ...
The Law's user avatar
  • 255
1 vote
1 answer
5k 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 ...
albciff's user avatar
  • 123
4 votes
2 answers
4k 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 (...
lightning_missile's user avatar
1 vote
2 answers
3k 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 ...
Khadim Ali's user avatar
4 votes
2 answers
2k 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) ...
Abhigyan Mehra's user avatar
1 vote
0 answers
540 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); /...
112233's user avatar
  • 147
1 vote
0 answers
90 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 ...
Jay's user avatar
  • 29
1 vote
2 answers
114 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 ...
James Culshaw's user avatar
2 votes
2 answers
3k 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 ...
Grateful's user avatar
  • 149
-2 votes
2 answers
146 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 ...
The Law's user avatar
  • 255
0 votes
1 answer
358 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 ...
Saket Anand's user avatar
1 vote
1 answer
2k 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 ...
Jay's user avatar
  • 29
7 votes
2 answers
5k 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 ...
Alex's user avatar
  • 173
-1 votes
2 answers
412 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 ...
user6227254's user avatar
27 votes
1 answer
21k 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 ...
Marc's user avatar
  • 545
1 vote
3 answers
102 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/...
Robert Dickey's user avatar
1 vote
1 answer
245 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 ...
Pratish Shrestha's user avatar
1 vote
0 answers
1k 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 ...
BarryBones41's user avatar
2 votes
1 answer
2k 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 ...
Luke's user avatar
  • 123
0 votes
3 answers
88 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 ...
Zerquix18's user avatar
  • 125