AJAX (Asynchronous Javascript And XML) is a popular technique for creating interactive websites, though other technologies (e.g. JSON) are often used instead of XML.

learn more… | top users | synonyms

-3
votes
0answers
19 views

Javascript - Handling race condition on async function call [on hold]

This weekend, I ran into a peculiar problem of handling race conditions in Javascript. Here is the code that was giving me problem: ...
6
votes
1answer
162 views

LiveDate version 2

LiveDate has the ability to display the current date either by asynchronously fetching the time from a server or by just using the client system date. It's only as ...
0
votes
0answers
16 views

Send Ajax Request Function v2

I would like to get a full on review on my sendAjaxRequest function. Suggestions for any improvement are always welcome! sendAjaxRequest.js ...
0
votes
0answers
38 views

Building JSON array containing HTML

So, One of my companies developers wrote this. Not me. Alright, it was me. How can improve this puke? ...
1
vote
0answers
24 views

Simple AJAX library in JavaScript

I've created two simple methods: one to instantiate a new XMLHttpRequest object and open the request and another to handle the request. Can you please point out ...
2
votes
1answer
44 views

Class that make asynchronous http requests

I made this function to act sort of like jQuery's $.ajax. I intend to use it in small projects where I do not use jQuery (I don't want to load a whole framework ...
0
votes
0answers
33 views

Implementing Ajax deferred/promise patterns

I have a testcase where I want to send a request to the server every time a form field change event occurs. The implementation below works as expected until I ...
0
votes
1answer
49 views

Ajax Done Callback to prevent requests from interrupting each other

I am trying to make sure my Ajax does not send another request before it receives a reply. To the best of my knowledge the code I will post is supposed to do this but I am still getting a -1 for ...
2
votes
1answer
138 views

My AJAX LiveDate Object

The LiveDate object displays the live current date and has a sendAjaxRequest() function dependency to send the AJAX requests. ...
3
votes
0answers
47 views

Ajax file uploader jQuery plugin

I tried to write my first jQuery plugin. It's a very simple Ajax file uploader. I would appreciate a review of this code. HTML ...
2
votes
0answers
38 views

React Flux structure for a shopping app

we have just started up a new app and we are using React with the Flux architecture, we have done our best to piece together what we think is the best structure for the app and would appreciate any ...
1
vote
1answer
53 views

Return fake jqXHR from custom Ajax method

I have several methods that wrap the $.ajax() method and return its jqXHR, but I need to force fail before even calling the original ...
1
vote
1answer
71 views

Rewriting this function to use `promises` instead of `async: false`

Using parse.com's javascript API, I would like to get a variable number or images from img tags on a page and save those images in the currently logged in user's ...
0
votes
0answers
37 views

Make knockoutjs model simpler and avoid full observable array refresh

The form creates / updates /deletes a category. The category is simple: ID and name properties in backend (Laravel) model. UI: Clicking on a category enables "edit mode": I need 2 things here: ...
3
votes
0answers
110 views

Laravel controller for a commenting system

Can someone review my Controller? I should follow these guidelines: Code should be written with MVC pattern and to use OOP. The code now works fine, but I need to improve it. Also, should I use ...
0
votes
1answer
50 views

All-purposes AJAX handler made with PHP and .htaccess that speaks JSON - Part 2

Earlier, I've posted a question about a file used to handle AJAX requests. I've followed some of the advices given and made some changes on the code itself. You can go on "All-purposes AJAX handler ...
0
votes
2answers
61 views

All-purposes AJAX handler made with PHP and .htaccess that speaks JSON

In a project I've started, I decided to implement some new code to handle AJAX requests. The requirements are that it can ONLY access the /ajax/ folder, load ...
3
votes
2answers
115 views

Is my login system secure?

I am recently making a CMS and I need a secure login system, so this is my code. How is it? First: the HTMLcode for signup and login: ...
1
vote
2answers
69 views

Alternate for nested Ajax requests

I have one button on clicking I need multiple things need to be done, so I went for AJAX and PHP: ...
0
votes
0answers
99 views

Using CasperJS to fetch and fill option values

I use the following CasperJS code to fetch data from an ASPX page with combo drop down box, which option values are dynamically populated via __doPostBack(). the ...
2
votes
0answers
64 views

Creating chat box with comet

I'm writing chat application. I would like to know if there are problems in this code. This function sends message: ...
2
votes
1answer
75 views

AJAX call with repetitive success/failure handlers

There's some repetition in here. I tried making it into a function but then the response wasn't filling up the ...
4
votes
1answer
128 views

Removing popup notification, the dirty way

I'm new to coding and I am self-taught up to this point, so my scope for creativity is quite limited. As such I'm doing something in particular that I suspect isn't the "best" way of achieving this ...
3
votes
2answers
127 views

iPhone notes application replica using HTML/CSS

I've written a web application that is a replica of the iPhone's notes app. It turned out quite well, you can do everything you can on the iPhone's app except for sharing and sending it via texts etc. ...
4
votes
1answer
145 views

PHP & AJAX live chat - alternative ways

I am trying to implement a live chat for my websites visitors. Currently I am using the code that you can see below - a PHP script that processes in background and that is called by AJAX. I am not ...
10
votes
2answers
265 views

jQuery AJAX form using bad practice

I have not worked with jQuery for years so my knowledge of it is extremely limited. I wrote the following form and received a comment elsewhere saying: This is some of the worst JavaScript I've ...
1
vote
0answers
48 views

Handling pagination on a particular page

I have a Java script that handles pagination on a particular page by using a jQuery pagination plugin. Is there any way to improve the code? ...
3
votes
1answer
211 views

Loading and displaying JSON quickly in PhoneGap app

I have this tap event in an iOS app that I'm developing with PhoneGap. When I click on the left arrow, it finds the desired content and retrieves it from a JSON file. It then displays those results on ...
1
vote
1answer
57 views

Performing an auto complete look-up and building a form

I have written a jQuery function that is doing an auto complete look-up and then building the form for me. This is working fine but I want to reuse the code so I can have the form rebuild after ...
2
votes
0answers
28 views

Refreshing / Cycling through a parsed RSS feed every 5 mins

I am working on a monitor signage display and have a "welcome to RSS" feed with just a title and desc. I have code from feedEk that's been tweaked a bit to parse the feed and cycle it so I only have ...
3
votes
2answers
320 views

Generic method for HTTP GET/POST parameter conversion

I just made a method that should handle GET and POST parameters (primitive types) sent by AJAX requests to the server: ...
2
votes
1answer
352 views

Simplify double AJAX request for jQueryUI's autocomplete widget

I'm using jQueryUI's Autocomplete widget for a product search. The data is in a database, so as the souce I passed it an AJAX request. My problem is, that I need some data about the currently focused ...
2
votes
0answers
191 views

Upload multiple files in different formats and sizes from one HTML form

I have a html form with some text input fields and three file upload fields. two of them should be images and one should be a file (pdf). My code is working well but I feel this is not the proper OO ...
1
vote
1answer
72 views

Light, custom CMS for a site

I'm working on a light, custom CMS for my site and I am trying to use Ajax calls for most of the server-side interaction. I am still pretty new to web development, so if I am breaking any conventions ...
3
votes
2answers
2k views

Insert JSON data into rendered template after AJAX call

I have an already rendered template and I want to update it with some JSON data I obtain via AJAX. The template as it is before rendering looks like this (using ...
3
votes
1answer
112 views

Secure authentication using JavaScript module pattern and an AJAXified modal window

This code is not live, but for brevity I'll write as though it is. When a user clicks any element with the class name js-modalOpen, for example: ...
3
votes
1answer
253 views

Database of Pokemon

I've just started to write jQuery and have just written my first code using ajax calls. I'm fetching data from the pokeapi and am using it to random generate new pokemon. I have refactored it as ...
1
vote
1answer
144 views

Checking form input for an AJAX request

I've made a few functions to check form input for an AJAX request. I am still getting used to JavaScript and some of these AJAX requests. I am looking for any suggestions to better work with ...
2
votes
2answers
984 views

Using jQuery and AJAX process a form with PHP

I'm looking to collect form input and pass it to a file called processing.php with AJAX JS: ...
14
votes
2answers
1k views

Is this form submission validator professional?

I have written some jQuery code for AJAX form submission: ...
3
votes
2answers
104 views

Better paradigms for posting JSON from a table?

With a table based interface where users can update the rows by pressing a button. Perhaps there is a better way of doing this, without pressing a button, i.e. post on textarea/row change (could be a ...
5
votes
2answers
350 views

Displaying styled validation messages to user

I'm new to AJAX and jQuery, and just for testing, I created this simple code. When the user enters their First Name and their Last Name it displays a message that says Thanks for entering ...
2
votes
2answers
426 views

Is there any disadvantage of using MVC Razor Syntax codes inside a NoScript tag?

I'm creating a ASP.NET MVC Website that display blogs from the database by AJAX. The problem is - I have limit the results to only 10 by default and add a Load More button to display 10 more results ...
-2
votes
1answer
327 views

Loading data from SQL server to webpage takes too long

There's a div in my webpage which will load data from an SQL server when the user clicks the button loadresource. Here's the JavaScript for button click: ...
4
votes
1answer
155 views

Random select in two MySQL tables

I wrote a simple AJAX request that performs a random select in two MySQL tables. The thing is, my current script involves connecting to the database and creating a new PDO every time the ...
4
votes
1answer
77 views

Calling PHP file using Ajax

I like to know if there will be any performance issue if an xmlhttp object is created every time. For example, in the below code: ...
2
votes
1answer
542 views

AJAX request authentication to PHP script

Recently I started looking at my AJAX call security and found some code that uses tokens, request and referer in an attempt to authenticate the call and stop XSS and CSRF. The AJAX calls are for the ...
1
vote
1answer
140 views
3
votes
2answers
166 views

Determining if an entity exists in a database via a stored procedure

Here is a short and simple Ajax method that returns "True" or "False" if an entity exists in a database via a stored procedure ...
3
votes
1answer
140 views

Ajax for RESTful web service

I wrote an Ajax function, which should be used in a framework to interact with a webserver. The (self-written) Java-Webserver can be used to fetch files and folder-contents, create files and folders, ...