Questions tagged [ajax]

AJAX (Asynchronous Javascript And XML) is a popular technique for creating interactive websites, allowing web content to be updated asynchronously by exchanging small amounts of data with the server behind the scenes.

Filter by
Sorted by
Tagged with
1 vote
1 answer
32 views

Chaining backend calls from VueJS method using Axios

This is the first ever bit of front-end code I have ever written, I have tried to adapt the existing call that is there to the backend using axios, so I check on of the response object value using the ...
user avatar
  • 487
0 votes
0 answers
93 views

PayPal payment logic in AJAX/PHP/Laravel

I've just finished setting up the PayPal checkout integration for my Laravel web app. It successfully processes a transaction and persists it in my database, and I want to make sure something as ...
user avatar
2 votes
0 answers
47 views

Random Astronomy Photo: React app using NASA's Astronomy Pic of the Day API

Random Astronomy Photo About the project This is a React app that generates a random photo from NASA's Astronomy Picture of the Day (APOD) API along with some interesting facts about it. This is my ...
user avatar
0 votes
1 answer
78 views

Upgrade security and code quality of a website contact form

I have a simple website contact form created back in 2017. The form was developed using PHP, PHPMailer, jQuery, HTML and CSS. I would like to make sure the code is up to modern standards and secure. I ...
user avatar
4 votes
2 answers
78 views

using PHP and JS to fetch data for an entry

I need to fetch some data from a mysql database. For that I created get_data.php on the server and a js function to retrieve that data on the client. Is this the proper way to do it? What would you ...
user avatar
2 votes
0 answers
68 views

Go REST API feedback [closed]

My intention is to create an API as generic and DRY as possible using Go. To achieve this, I have made some more or less common decisions: To use AJAX call to avoid reloading page when updating the ...
user avatar
  • 121
3 votes
2 answers
286 views

PHP blogging application with AJAX loading

I have been working on an online newspaper/blogging application with CodeIgniter 3.1.8 and Twitter Bootstrap 4. The latest feature added is lazy loading of posts. From the Static_model (...
user avatar
2 votes
2 answers
76 views

JS script fetching GitHub API for personal website

I've built a very simple personal website, everything is in a single file because it is very straightforward, but I think the JS script could be better structured. All it does is fetch some repos from ...
user avatar
4 votes
2 answers
3k views

Laravel 8 registration and login with user profiles

I am working on a Laravel application (Github repo) that requires user registration and login. Alter registration, the users can change their registration details (except password, for which there is ...
user avatar
1 vote
1 answer
40 views

Posting data via fetch and handling network errors

I've built a login panel, which will submit an email and password via fetch/POST. And I wanted to know the best way to handle network status errors? Reason being, as I want to inject error messages ...
user avatar
1 vote
1 answer
400 views

Newsletter Subscription Functionality in Codeigniter 3

I am working on a online newspaper/blogging application with CodeIgniter 3.1.8 and Twig. The application is meant to offer developers and designers the possibility to very easily turn their HTML ...
user avatar
3 votes
2 answers
81 views

Display of doctors by category, ajax

Apologies in advance for my english... We have a list of categories and a list of doctors, you need to output as follows: category1 item1 item2 item3 category2 item1 item2 item3 Here is what I ...
user avatar
3 votes
2 answers
218 views

A contact form with CodeIgniter and Twig

I am working on an online newspaper/blogging application with CodeIgniter 3.1.8 and Twig. I use the Twig template engine for the front-end views. I have put together this simple contact form which ...
user avatar
3 votes
1 answer
477 views

Make Pagination using Ajax with Jquery, PHP, History.pushState()

Finally after a few months of searching and learning AJAX with pagination PHP and History.pushState() I created AJAX PHP pagination. Test page 1. Ajax(index.php) ...
user avatar
2 votes
1 answer
31 views

Is there a way to consolidate Ajax dropdowns that filters data from MYSQLi database

I recently started a project which has a database of rail cars for a train simulator. Im trying to set up a way to filter the data based upon 4 categories "Car Type", "Road Name", &...
user avatar
  • 121
5 votes
1 answer
706 views

AJAX with Vanilla Node.js/JavaScript – POST JSON without a form

I am new to node.js, ajax, and asynchronous code. I’ve pieced together a working way to exchange json between browser and server and am wondering if someone with more experience considers the approach ...
user avatar
1 vote
2 answers
114 views

Displaying filtered user data using Ajax and PHP

I want to get my code cleaner and more efficient. This code gets variables form a PHP file and filters it to show the selected user name, all available usergroups on a list box and the groups he is ...
user avatar
4 votes
2 answers
74 views

Filtering from a file to show information

I want to get my code cleanner and more efficient. This code gets variables form a PHP file and filters it to show the selected user name, all available usergroups on a list box and the groups he is ...
user avatar
4 votes
1 answer
30 views

Simple marker rendering

I am trying to render in a leaflet map that should render a single marker. I am building the JavaScript as follows. build the map an even listener for when the user opens the page where the map is ...
user avatar
1 vote
2 answers
166 views

Is this code written safe from attacks?

I have small question. I don't know much about JavaScript (jQuery) or AJAX and I don't know whether I'm doing it safe from XSS Attacks, SQL injection and that stuff. I think the PHP with MySQL would ...
user avatar
3 votes
0 answers
331 views

Dynamic dependent dropdown in jquery

I'm trying to create a dependent dynamic dropdown in jQuery, in which the number of dropdowns is not fixed. Let's say we've four provinces, each has cities, and each city has sections. Each section ...
user avatar
3 votes
2 answers
131 views

Getting data from database through Ajax post request

Is the method used below to get data from a database efficient and optimal? The data is in a MySQL database, and in my server I have a PHP file with the following code to return some information: <...
user avatar
2 votes
2 answers
102 views

Continually refresh game data using AJAX

I've been working with JavaScript and AJAX a lot in the past, and now I'm moving towards the backend and working with databases more. I want to update my game data in as close to real-time as possible ...
user avatar
1 vote
1 answer
1k views

My method of php ajax product filter with pagination

After a few weeks of searching and learning ajax, pagination php, product filter, I created ajax php product filter with pagination. 1. index.php ...
user avatar
4 votes
2 answers
109 views

Quickly throwing together a text-and-button-based client-server web game

With much of the world in lockdown at the moment, my friends and I wanted a way to play our favourite game, Celebrity, over video chat. This seemed like a fun coding project, so I put together a ...
user avatar
  • 188
1 vote
1 answer
878 views

The most minimal way to retrieve live data using setInterval

I am writing a script that is supposed to retrieve some data from a MYSQL database but I need to make it happen live and after lots of research I learned that this thing can be done using something ...
user avatar
  • 113
1 vote
1 answer
69 views

Display name and email fetched using JSON API when hovering

I'm learning AJAX JSON. I'm just testing how to pull the data. The idea is, when hovering over the number, it pulls the data and show the content for name and email. Number 1 is to show name and ...
user avatar
  • 11
3 votes
2 answers
101 views

Health Test App, It Returns a Score Based on the Answers Given

Here is my parent component: App.vue. I was wondering what improvements I could make to the code here. Application Description This application was built off the Vue.js framework and utilizes a ...
user avatar
2 votes
1 answer
318 views

Loading KML files into leaflet Javascript map

This is working code for input KML files into leaflet map ...
user avatar
  • 259
4 votes
2 answers
136 views

AJAX communication with pure JS and PHP

I'm looking for a good approach to AJAX communication using only pure JS and PHP. I would like it to be as safe as possible and compatible with most modern browsers and IE 10+. I did some research and ...
user avatar
2 votes
0 answers
2k views

Contact form with AJAX call and secured PHP with Google reCAPTCHA v3

here is a code of a simple contact form that I have created, I believe that the form is server-side protected against empty fields, header injections, CSRF, XSS, bots using 'Google reCAPTCHA v3' and ...
user avatar
  • 121
8 votes
2 answers
281 views

Vanilla Javascript: Chained AJAX request

I'd be grateful for a review of my AJAX request. If I have taken the correct approach here and especially any security concerns! I am creating a Purchase Order system for my manager (as part of an ...
user avatar
  • 201
3 votes
1 answer
77 views

Ajax function with a callback

I have Ajax function with a callback which fetches all the Patient data however I have some perfomance issues and trying to figure out what it might be, does anyone have idea? That's my Code ...
user avatar
  • 33
2 votes
1 answer
58 views

Dynamically inserting html from external file and updating the database

I need some suggestions on how to approach this. I want to allow users to create sections of website. The code so far is working but since I am new to back-end I feel like there is better, more ...
user avatar
  • 21
3 votes
0 answers
189 views

PayPal Checkout API with PHP - Sending and retrieving additional data safely

I am learning to use the new API version of Paypal, and I have some doubts. Note: I've tried this on https://www.sandbox.paypal.com and it works, I have not done the tests on Live. onApprove: I ...
user avatar
4 votes
1 answer
126 views

Pulling data from the GitHub API for user repositories

I'm looking for specific feedback on a major design change that I plan on making to my personal website (https://aleksandrhovhannisyan.github.io/). Currently, the Projects section contains hardcoded ...
user avatar
3 votes
2 answers
82 views

Shopping cart with Ajax

I build a cart for an ecommerce website, and I want to know if I did well. I want to record the changes in the DB and display the information from the DB to the customer. To be sure that what he sees ...
user avatar
1 vote
1 answer
38 views

Thoughts on using curly-brackets-less while loop with a try/catch? [closed]

I need to fetch data from an server that isn't always reliable and unfortunately fixing that is out of my hands. My team determined we would attempt the request up to 3 times. So I thought of using a ...
user avatar
1 vote
0 answers
87 views

Make Pagination using Ajax with Jquery, PHP [closed]

This is the first time that I have add (I mean, I try) Ajax with Jquery to PHP and Mysql (pagination). This is a link to the test page: testpage1 I think everything works, but is it done correctly? ...
user avatar
0 votes
2 answers
1k views

Asynchronous query to load products from laravel controller

The following code works fine. When a user clicks on an element, an AJAX request is made, which will return the query result. The results are being displayed in a view. I read many articles where ...
user avatar
2 votes
1 answer
314 views

Passing data to HTML template

How can I pass data from database to my HTML template without putting PHP code in my HTML file. Thanks. This is my controller ...
user avatar
2 votes
0 answers
70 views

multiple AJAX requests and multiple SetTimeout animations

I wrote a piece of code that included multiple AJAX requests and multiple SetTimeout animations. I want the code to perform better, especially the SetTimeout sections. which part of the code should ...
user avatar
  • 81
0 votes
1 answer
458 views

Hotel Booking functionality - handling UTC dates & timezones

People here often ask to share as much code as possible. My app is just a sandbox, a typical freshly created AspNetCore + Angular template without much code. So please don't blame me - I provide ALL ...
user avatar
3 votes
1 answer
475 views

Edit button toggles modal and load data from PHP using AJAX and JQUERY

I've been working on an edit/update button that will toggle a modal that looks like this: Is there a better code for this JavaScript code that I made? ...
user avatar
9 votes
2 answers
220 views

Fetching movie data using jQuery

Requirements Display movie datas inside all tags that have the class movie_list Make an ajax call for fetching movie datas Fill loading text before fetch data If any error occurs during loading, the ...
user avatar
  • 91
0 votes
1 answer
83 views

Updating values in a database

I'm using standard jQuery Ajax to update values in the database and reflect the result in an output. This repetition seems like bad practice and I don't know enough about jQuery to consolidate this ...
user avatar
3 votes
1 answer
627 views

PHP AJAX handler to fill an HTML table

I would like to know if this code follows recommended practices and standards for AJAX/PHP calls. Can this AJAX + PHP code be improved in terms of security, performance, etc.? ajax.js: ...
user avatar
  • 131
1 vote
0 answers
566 views

Load more and filtering - WordPress AJAX

In my WordPress theme I have built a function that uses Isotope Layout by Metafizzy to accomplish filtering and sorting. I have used a mix of AJAX and JQuery to accomplish this, however I feel the ...
user avatar
0 votes
1 answer
55 views

Displaying multiple objects on map and calculating distances using google api

I am quite new to Javascript. For a school project we wrote a website that displays the user's location on a google map alongside with some objects such as vehicles or passengers. I rewrote my code ...
user avatar
3 votes
0 answers
1k views

AJAX shopping cart with quantity +/- buttons

I'm a junior developer (couple years into it) and very new to AJAX. I'm writing an internal inventory application built on MVC and right now I'm dealing with adding and removing items to/from a cart. ...
user avatar

1
2 3 4 5
8