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, allowing web content to be updated asynchronously by exchanging small amounts of data with the server behind the scenes.

2
votes
1answer
39 views

Symfony AJAX comment system with votes

How can I improve this code ? It was quite hard to implement AJAX comment system in Symfony 3, and result is a bit of mess: Controller: ...
2
votes
1answer
292 views

Upload a user's avatar

Could you guys tell me if my code is safe? And i want to know how to improve it. You will see a detailed explanation about the code on the comment blocks inside the code. profileIMGform.php <...
1
vote
4answers
57 views

Replacement function for jQuery .post

Today I just completed a personal POST function that emulates jQuery's using $.ajax, but also implementing a possible redirect. I just finished up and it looks like it is functional, but since this is ...
2
votes
1answer
34 views

Chart of answered CR posts percentages over time - Part 2

I created a graph to show the change in the percentage of questions answered over time and the first version fetched data from chat transcripts using PHP. The sub-domain I have registered for my ...
1
vote
1answer
53 views

Notification system using PHP+jQuery+Ajax

I have this code to display a counter on the side of <i class="fas fa-bell mr-3"></i>. I want to know if this code is good on security and perfomance. ...
0
votes
1answer
51 views

Preparing form data for a POST request with fetch

Acquiring a form’s data for asynchronous POST requests has been a long-standing problem. There is the FormData API, but there are still some obstacles when the form’s data is encoded as ...
0
votes
1answer
58 views

Back end validation as front end validation

I am trying to use the back end validation for front end validation and this is what I got. Maybe there is a better way to do this? If someone knows please share the knowledge. HTML: ...
0
votes
0answers
28 views

License Manager PHP Class

I'm workin on this code that will be a licensing class integrated with an electron app. For now it's a simple object who will generate and check for a licence stored inside the electron app folder. I ...
3
votes
1answer
42 views

Ajax table action and process

I'm trying to learn Ajax better, and I'm developing an application in CodeIgniter. The following code is working, there are no errors. But for every function and call I think I'm repeating callbacks ...
1
vote
0answers
20 views

Deletion button on a website that enforces database integrity

I am designing a website on which users can configure (CRUD) various objects which are mutually dependent upon other types. I am preventing a cascade delete, so let's say a ...
4
votes
1answer
95 views

Effective to-do list in PHP and jQuery AJAX

I made this to-do list since I never seriously used jQuery (in particular way AJAX) and I need this kind of script for a project that I'm working on. Principal features: Use of a database to manage ...
1
vote
1answer
119 views

WeatherApp, working with APIs

I'm making a WeatherApp. It uses the browser's location to get the GPS coordinates, then sends those to an API to get details about the location (e.g. city, country, etc.). The city is then sent to a ...
0
votes
1answer
50 views

jQuery AJAX submit form

This jQuery code submits a form using AJAX. The server response should return JSON. ...
0
votes
1answer
58 views

pass argument to jQuery .on() event handler callback [closed]

In my web application, a user will click a button which will call a function that triggers an AJAX call. That function accepts a single argument. I would like to be able to put that function in ...
3
votes
1answer
2k views

Send blob image using Ajax/PHP

I have an image cropper that crops the uploaded image, Before sending it to the server using PHP and AJAX. Here is a live fiddle to preview a working cropping example. Here is the code: ...
3
votes
1answer
95 views

Paginated AngularJS posts application

I have made a small application that displays a posts JSON in the form of cards, with the help of AngularJS and Twitter Bootstrap 4. The application has an interface for pagination and there are ...
5
votes
2answers
103 views

Upvote/counter in Javascript

Looking to improve building UI in pure ES6. This is the pattern I have adopted and has worked fairly well. This code increments the count, sets a data attribute to toggle the button, and issues a ...
3
votes
2answers
43 views

jQuery handler to update map UI based on AJAX response

I am working on a university project that consists of creating a map application with openlayers as well as the necessary User-Interface. I am using jQuery, native JavaScript, PHP and of course HTML/...
3
votes
2answers
63 views

Update game content via AJAX

On my application, I have a JavaScript cycle that updates tag contents on my page regularly: ...
0
votes
1answer
19 views

Click a link to delete targeted content using Ajax

I wrote a glypicon as a link to delete a comment: ...
0
votes
0answers
264 views

Implementing Google ReCaptcha and PHPMailer

I have a contact form that performs validation on the server side with error messages being printed by JavaScript. I am curious if my implementation of Google ReCaptcha is correct, since my other ...
1
vote
0answers
17 views

JSON API Scraper v2: Limited concurrency AJAX from a shared queue (ES2017)

Essentially the AJAX component of this question, reimplemented in ES2017 style async/await. The code connects to a remote JSON API and scrapes it using a limited number of streams to avoid triggering ...
2
votes
2answers
87 views

Basic PHP template loader

For a project, I need to write a basic template manager who will be responsible to load the requested HTML or PHP template when the user clicks on a menù link. It's like a page loader since that all ...
0
votes
1answer
96 views

Writing cleaner PHP code to add additional options

I have a contact form that will perform validation on the server. Right now the form checks if the fields are empty or not. My goal is to expand it following: Check the fields for particular format, ...
0
votes
1answer
33 views

Simple AJAX view loading approach

I'm writing my own MVC framework for learning purposes. Usually in my projects I like to use AJAX to send requests and retrive data. Now my doubt is if this can be ...
0
votes
1answer
67 views

Live search project

I have a live search project and I don't know if it's secure enough or not. I don't access it directly, but I get data by JSON so I shouldn't worry about slashes or quotes, right? The PHP code: <...
4
votes
1answer
142 views

Upload and database insert php function

I love to post here on codereview my code to have a feedback from developers that have more experience than me, to improve my coding skills. During these days I'm working on a webapp for a small ...
0
votes
0answers
19 views

Jquery AJAX client side controller design

I'm working on the client side of a webapp. I've already posted the PHP logics here on codereview and your suggestions have helped me to improve a little bit the code. I'm using ...
1
vote
1answer
55 views

store and warehouse management class

I've already posted this PHP class few days ago when I started writing it. Now that all the methods and all the controller logics are ready, I will be ask here for some suggestions about how to ...
0
votes
1answer
19 views

Get real time geojson on Javascript

I frequently need to obtain some info about coordinates, because I have dynamic elements on a map (in Openlayers). So I use SetInterval and XMLHttpRequest Object to do it. ...
0
votes
0answers
16 views

Navigating Through Calendar Weeks

I'm displaying a week-long calendar with "previous" and "following" links: ...
0
votes
1answer
502 views

Handling keyup events with throttle or debounce in Javascript/jQuery

In my web application, there is a search input field, and when the user empties all of the text inside the input field, there is an API call made for a default-list of results, which are displayed in ...
0
votes
1answer
31 views

Accumulate ids to make a single ajax request

I have multiple places where I need to make ajax requests to fetch the items corresponding to some ids. However, I only want to make a single request by accumulating these ids and debouncing the ...
2
votes
1answer
48 views

Simple AJAX request application

Today I created my first simple AJAX application. It works fine, but I am a bit unsure if I did everything correct. I'd like to use the code as template for future projects. ...
1
vote
1answer
54 views

Managing Ajax calls

I've gotten fed up of writing boilerplate code for managing Ajax calls, and this is the manager class I've come up with The concept is that it standardizes the interface for RESTful calls, prevents ...
2
votes
2answers
59 views

POST to endpoint and GET data back

I'm working on a little project and although it all works, I think I might be doing it in an incorrect way. The front end consists of a simple form that gathers input data (make and color) and once ...
3
votes
0answers
47 views

Search feature built with jQuery AJAX

This is front end code for a search feature that searches for characters. It uses the users search query to return an array of matching characters, which then gets displayed in a search list for the ...
0
votes
0answers
53 views

Display Partial view after submit button

Please suggest a good way of submitting the partial view form after submit. Currently, I am doing it in this way which I think is not a proper way. As there are more than one records in the main view ...
2
votes
1answer
123 views

Laravel Single Page Application Using Angular Js

I have created a Laravel Single Page Application using Angular Js 1.3.14 by learning tutorials in the websites. index.php: ...
1
vote
3answers
129 views

Custom function for serialization of form inputs (and selects)

Just asking to if following code is ok since i needed didn't find equivalent of .serialize() for vanilla JS. So i invented my own function for plain ol' JS. ...
2
votes
2answers
125 views

Loading html from file using JavaScript

Today I was trying to load navigation bar from another HTML page. Here is code, that I am using. What do you think about it? Is there any other way to do it? ...
2
votes
2answers
385 views

Get JSON script code with pushing to heatmap

I have a script that makes a database call and then filters the results. After filtering it pushes it to an array and shows it on a map. Here is my function: ...
1
vote
1answer
92 views

Fetching and parsing JSON data from the Oodle API

Here is a working proof of concept in vanilla JS that uses the fetch API to retrieve and parse JSON data. Coming from a server-side background, I wanted insight as to where my beginner JS skills could ...
7
votes
4answers
470 views

Country Guessing Game

I'm learning React and I request you to review it. Preview it here ...
2
votes
1answer
71 views

AngularJS - Making Factory and Controllers DRY

The following code works, but: The service makes multiple API calls, the functions are very similar with a lot of code duplication. The same is true for the controllers- very similar code with only ...
3
votes
1answer
924 views

Processing concurrent AJAX requests

I am trying to process concurrent AJAX requests with vanilla JavaScript. Below is the sample code I've been working with ...
1
vote
1answer
51 views

DRYing out my action creators

I've created a private function called _successResponse to handle successful responses from my promise. The challenge was passing the dispatch function to the <...
5
votes
3answers
715 views

Ajax Voting System

Everything works, but my strong suit definitely isn't JavaScript or jQuery. I'm sure there is some way that this can be accomplished that doesn't look so hacky. HTML: ...
1
vote
1answer
1k views

Securing access to PHP services from Javascript Ajax calls

I am creating a generic PHP handler, or "dispatcher", for Ajax calls made from Javascript running on the page served by PHP. The handler will take posted data and, depending on a value, decide how to ...
0
votes
2answers
3k views

CodeIgniter CRUD using AJAX

I am trying to use AJAX with CodeIgniter. I have some code, but I am not sure that the code is in proper way / officially correct according to the programming way. All I want is that if someone in the ...