Questions tagged [ajax]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
51 views

Ajax with interval vs WebSocket

I am currently developing a script for real estate which tries to find a match between your products and your clients needs. So I need to give the user a notification whenever a match is found, I am ...
0
votes
0answers
19 views

Filter Gallery Images based on dropdown selection values

I currently making a "visual plan builder" with php-mysql, ajax and jquery Using multiple layers (z-index) I generate a visual plan with the following dropdown list values: Base Product - ...
1
vote
1answer
42 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, ...
-1
votes
2answers
76 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 ...
-4
votes
3answers
84 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 ...
2
votes
2answers
95 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 ...
0
votes
1answer
145 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 ...
2
votes
1answer
717 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 ...
2
votes
1answer
35 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
259 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
2k 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']) &...
1
vote
2answers
830 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
840 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
144 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
2k 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
604 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
1k 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
323 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
60 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
91 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
1k 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
67 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/...
79
votes
12answers
39k 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 ...
2
votes
1answer
166 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
94 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
98 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
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....
-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
3k 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
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 ...
0
votes
1answer
4k 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 ...
4
votes
2answers
3k 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
2answers
2k 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
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) ...
1
vote
0answers
516 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
82 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
108 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
1k 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
145 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
354 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
1k 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 ...
5
votes
2answers
3k 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
373 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 ...
22
votes
1answer
15k 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
3answers
95 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/...
1
vote
1answer
221 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
884 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
1k 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
73 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 ...