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

0
votes
0answers
19 views

How can I prevent 'show' event in Bootstrap from reloading content each time? [closed]

I'm building a site which has a set of image carousels that are embedded in a set of tabs (each tab has 4 carousels, each of which is it's own tab). There's a ton of images to load for each carousel ...
1
vote
0answers
73 views

Code to update content via ajax

Following is the code to update content via ajax. Please review all aspects of the code. var ajaxUpdate = { init: function(){ ajaxUpdate.enableHistory(); }, _this:null, ...
1
vote
1answer
40 views

Each-loop in success with cloning. Is there a better way of writing this?

I'm cloning a fairly complex div/ page and changing various things in it before appending it to the DOM. The current method seems long-winded, and I was hoping if there was a simpler way of doing it? ...
1
vote
1answer
33 views

Simplifying an ajax script in my HTML

I'm using Twitter Bootstrap and I'm working on a page that has several tabs that all have carousels in them (each with a ton of images) I've managed to write an AJAX script that pulls the images from ...
0
votes
0answers
27 views

Improve AJAX response handling function

This code handles a response from an RSS feed. It organizes and appends to content. If there's a video embeded then separate it from the rest of the content. I would like a review mainly on ...
2
votes
1answer
50 views

Implementing a cross-browser AJAX utility as an exercise

I am currently learning JavaScript and created this cross-browser AJAX utility as a learning exercise. It was not meant to be used in production code, and I just tried to cover only the cases that I'm ...
2
votes
1answer
97 views

How should I re-factor this code?

In my system there are 3 main functionalists. Add users to database Delete users from database Updater users This is the screenshot in my UI When clicking on the button of add new user, ...
3
votes
2answers
74 views

Querying a database with PHP

I'm new to PHP programming. I would love some feedback on this simple code I wrote which queries a database based on some arguments supplied by a user and returns an HTML table displaying the data. ...
3
votes
2answers
123 views

How to structure a Javascript module better?

There's this Ajax-heavy, JQuery-based site which I'm about to work on. There hasn't been much structure in the JS code so far (lots of functions at global scope, hard-coded in the HTML ...
0
votes
0answers
71 views

jQuery/AJAX Plugin for WordPress and Foundation Reveal: How can I improve this code?

I figure that someone here probably knows a much better way to do this. I'm still figuring out AJAX and jQuery, so I consider that I still need to master quite a bit of knowledge. My function ...
2
votes
1answer
86 views

Does this code look good?

I just want to know if there room for improvement or something I should redo to be better. Sorry for my lack of notes. var dataCell = new Array(); dataCell[0] = document.getElementById("data0"); ...
3
votes
1answer
52 views

Using AJAX to interact with MVC

I have the following ajax call: function getPreviewText() { $.ajax({ type: 'POST', url: '@Url.Action("PreviewWiki")', dataType: 'json', data: 'source=' + ...
1
vote
0answers
91 views

Multi-page form with each step loaded via Ajax - is this good rails code?

RoR beginner alert. I've building a multi-step form that saves data in multiple models. The "base" or parent model is the Venue, and *has_one* or *has_many* other models. In the screen below, the ...
1
vote
1answer
50 views

Cache mechanism with duration

I want to implement in my code a cache mechanism with a fixed duration. For example an iframe will be cached for one hour, or a script file will be cached for 24 hours. This is how I implemented it, ...
3
votes
1answer
79 views

JQuery code repetition and MVC

A while ago I started working on a project, which does things mostly with JQuery and PHP. I had some problems with my structure and started using CodeIgniter which uses an MVC pattern. So the PHP part ...
1
vote
1answer
52 views

my first jquery/json

This is my first use of jquery and json so would be grateful for any feedback please. Background - this is on a job listing site and it has a Linkedin apply button plugin - this provides for a ...
2
votes
2answers
223 views

Best way to structure PHP AJAX handlers?

I'm just getting started with AJAX and am unsure of the best way to structure a PHP AJAX handler. I created a PHP file, ajax_handler.php, and the way I have it structured now is just a bunch of ...
2
votes
1answer
613 views

My login with AJAX and PHP

In your opinion, do I need to do all these validations. I thought to do well and stay safe but I seriously raises the question if it isn't slower. jQuery code $(document).ready(function () { ...
-1
votes
1answer
143 views

ASP.NET MVC 4 Shopping Cart - Cannot update shopping car items using JQuery , Ajax, jSON, jGrid [closed]

I have this code in a C# MVC 4 VS2012 project. I need to be able to update the shopping cart with jSON data using JQuery/AJAX, i'm using jqGrid to display the data and pulling the shopping cart items ...
1
vote
2answers
2k views

Using AJAX to look up MySQL value using two dropdown inputs

I have a list of cities, and a set of "travel time" between any given two cities. The "travel time" is fixed and not necessarily dependent on absolute distance between the two cities, and it currently ...
2
votes
0answers
389 views

Display progress bar to show async. request status using JQuery

Instead of using ProgressBar plugin, I've below script to display the progress bar for async. requests on the page. Could anyone provide any feedback on this esp. if there will be any issues like ...
1
vote
0answers
136 views

Angularjs stream ajax responses?

The following service repeatedly queries urlToStream with paging parameters and appends the results to an array in a scope (passed in as a parameter). It works but feels dirty (not the least of which ...
1
vote
1answer
43 views

How Can I Improve my Image Preloading Script?

I wrote an infinite scrolling scrolling plugin for an app I'm developing. When requesting the second 'page' from the server, I loop through each image, and five it a very basic onload function. // I ...
0
votes
2answers
216 views

AJAX response DOM element selection

I GET a HTML response from AJAX over cors and the response is a table. Each category has its title and sub elements. The title names vary quite a bit and are likely to change in the future. The sub ...
3
votes
1answer
378 views

Filtering and Sorting jQuery Ajax response

What I'm trying to accomplish here is to pull a table of open employment positions with AJAX, filter out the garbage code that comes with it, put each <tr> from the response into its correct ...
0
votes
1answer
71 views

Is it possible to simplify my AJAX navigation code?

I'm still learning javascript and I'm building an ajax website that loads in content for each page from external files (e.g. test1.php, test2.php). I spent several hours cobbling together some code ...
0
votes
1answer
165 views

Authentication system using AJAX

I'm building an authentication system using a combination of PHP, MySQL, jQuery, and AJAX. The way I'm doing it right now is I have a form that takes in a username and password. When the user clicks ...
1
vote
1answer
74 views

How can I animate this foreach ajax call in jquery?

I have created an app in codeigniter that fetches some json data via ajax and displays it on the page. What i am trying to achieve is to load in a div per fan that is essentially just a box ...
2
votes
1answer
77 views

Passing a large amount of diverse information in JSON using Symfony 2.1 and Doctrine 2

For a project I need to give a load of diverseinformation in JSON format. All the information will be used on the same page so a single call would result in the least overhead. The information all ...
3
votes
2answers
162 views

Better way to return data via AJAX?

Let's say I have three files: a page that is used for searching data called search, a file that handles requests called controller, and a file that has functions which the controller calls based on ...
0
votes
0answers
195 views

Emulate jQuery's AjaxStart and AjaxEnd for native javascript

This is a javascript code that will be injected into every page a .NET WebBrowser component navigates to. This means the code needs to be compatible with IE 7+ only. The code will be injected and run ...
6
votes
0answers
251 views

My PHP AJAX bridge to jQuery library

I've been working on this library for 2 years now and using on many websites with great success. And I decided to make it public, I can assure this is the best jQuery <=> PHP bridge library there ...
1
vote
2answers
749 views

Jquery AJAX and PHP sessions

I have been working with PHP sessions and login protected pages for some time, but i want to start using some AJAX for managing some actions inside login protected pages (easy way with Jquery). I am ...
3
votes
2answers
585 views

How are my javascript module pattern and promise pattern?

I'm working on an app that downloads some SVG paths from a server and draws them. Anything in here is open to critique, but specifically I'd like to review my use of a module pattern and my ...
1
vote
2answers
154 views

Optimize JQuery/JavaScript Link Checker

Below is a script I've written that uses AJAX to check if all links on the page are alive or dead. Could this be modified to be more efficient in any way? Thank you very much. ...
2
votes
2answers
328 views

Review My Custom Streaming Application - AJAX / TwitchTV

So I created this custom application and ported it into a few websites. It uses the TwitchTV API and pulls in active streams and the viewer count. The problem I run into is when the list gets so big ...
1
vote
0answers
329 views

AJAX MaskedEditValidator isValidEmpty property manipulation

thanks for visiting , this is my initial question that lead me to modify the behavior of AJAX MaskedEditValidator - isValidEmpty attribute. when you try to cancel the interaction with a form , ...
2
votes
1answer
83 views

Improve Jquery ajax response

this way I handle ajax response: success: function (json) { $.each(json, function(index,item){ if (item.field == "article_id") { ...
0
votes
3answers
355 views

How to append ajax return data to a table

I am trying to append data to a table based on the ajax returned data. My codes work but it seems ugly. I was wondering if anyone here can help me to simplfy it. Thanks a lot! ...
3
votes
2answers
236 views

How to improve a try on a dual Mode JavaScript textBox WaterMark?

I was just trying to make an alternate Ajax watermark from "insert date" (first mode) to "mm/dd/yyyy" (second mode). After some trial and error, I succefully implemented a solution using JavaScript. ...
8
votes
3answers
311 views

If I write spaghetti code, I'm gonna have a bad time. Help with this ajax/jquery logic please :)

This is a pretty simple script. In short it's meant to look for an id in the data attribute in each containment div, then send an ajax call to get the amount of retweets, calculate the karma based ...
4
votes
3answers
141 views

poor practice to place a ajax in the success of a previous ajax call? ajax-type inception?

Is it bad practice to have a ajax call fire in the success of a previous ajax call? If so, is it bad for readability or efficiency? My Example: $.ajax({ type: 'post', ... success: ...
1
vote
2answers
70 views

Possible redundant code improvement

first here is the code: Part 1 $('#monhpf').keyup(function() { /* General variable(s) */ var monhpf = $('#monhpf').val(); if(monhpf=="") { ...
1
vote
2answers
140 views

Does this javascript code leak?

I've been coding in javascript for a bit over a year now but never paid much attention to memory leaks. (I know I'm an idiot) I built my first long running AJAX heavy app and memory leaks are eating ...
2
votes
1answer
127 views

Closure handling in javascript / jquery ajax

I'm using this pattern (for want of a better word) repeatedly in my code to call a REST API in my javascript code. Some particulars of the code below. I have a ConfigViewer javascript class that is ...
2
votes
2answers
248 views

jQuery nested ajax deffereds- looking for improvements

Following is a working solution for a single xml ajax to retrieve category list, then individual ajax calls for each category. This was developed in response to a question on SO. Solution creates one ...
2
votes
2answers
471 views

Is this spaghetti code already?

I post the following code writen all by hand. Why I have the feeling that it is a western spaghetti on its own. Second, could that be written better? <div id="form-board" class="notice" ...
1
vote
1answer
282 views

Improve the performance of jquery/php generated map

We are building a interactive tile-based (32x32 px) (game) map where the user can move around. However we experience lag (some sort of a delay on the movement) and we need to work around this problem. ...
1
vote
0answers
133 views

AJAX user interface for wireless networks / Event-based flowcharts

I'm designing an AJAX interface which allows a user to remotely connect a device to a wireless network. The user is on a page with a list of wireless networks, and clicks the "Connect" or ...
0
votes
1answer
5k views

Form Validation using AJAX with PHP fallback

I've used this PHP/AJAX method of validation for a bit, but I think it could use a little peer review. The basic idea was to create a way of verifying forms in a nice manor using AJAX, but also ...

1 2