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

2
votes
1answer
65 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"); ...
-1
votes
0answers
26 views

Passing undefine vars. Help? [closed]

I am passing undefine var for my ajax function. I don't know why. I am tried of right now and getting annoying. Could someone help me? Sorry for the VERY VERY VERY and I mean VERY sloppy code. I'll ...
3
votes
1answer
41 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
24 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
34 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
59 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
43 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
137 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
96 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
121 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
191 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
165 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
64 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
38 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
172 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
264 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
62 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 ...
-1
votes
1answer
82 views

Why I need to use 2 functions, but not only one [closed]

I paste all of my code because it might have a connection with the function I am asking for. I had some problems with my parseJSON() function and someone helped me to make it work. Now I don't know ...
0
votes
1answer
119 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
votes
1answer
164 views

JSON array data posts but table does not update - PHP - Mysql - PDO - AJAX [closed]

I have a php script that encodes my db table into an array. I echo the json_encode and it echos just fine. script : <?php $host="localhost"; // Host name $username="root"; // Mysql username ...
1
vote
1answer
45 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
75 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
152 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
183 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 ...
5
votes
0answers
182 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
511 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
495 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
135 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
298 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
245 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
78 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
254 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
221 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. ...
7
votes
3answers
299 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
122 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
112 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
210 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
449 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
274 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
120 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
4k 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
vote
2answers
85 views

Better way to Rewrite?

The output result is perfect to what I wanted, but takes a tad bit too long to pull data then render into a graph. Is there a better way to rewrite this code to speed up the process? I'm all ears ...
2
votes
0answers
93 views

Is there any way to shorten up this Facebook API call?

Right now I am working on an AJAX call that grabs a random photo that a Facebook user is tagged in and then grabs the large source for it. Is there any way to speed this up or at least distill the ...
2
votes
1answer
208 views

JSON array href as a variable in jQuery

I have a getJSON function that converts the results to an html template to display as a list that contains a different hyperlink within each list item. I need to override the normal html function of ...
2
votes
1answer
338 views

AJAX alternative of using jQuery form ui

Hi everyone I was using the jQuery form plugin to process form submission (found at http://malsup.github.com/jquery.form.js) on my page but now have to switch to using an purely jQuery AJAX based ...
2
votes
2answers
186 views

Generalized Ajax function

Not sure if this question will be considered "off topic". If it is, I'll remove it, but: I hadn't see this yet so I wrote it and would like to know if this is a good approach to it. Would anyone care ...
3
votes
1answer
181 views

Simple XmlHttpRequest object

I would like some eyes on this: /* Little XHR * by: rlemon http://github.com/rlemon/ * see README for useage. * */ var xhr = { xmlhttp: (function() { var xmlhttp; try { ...
0
votes
0answers
646 views

JSF and Ajax : is it the good approach?

I'm new with AJAX. I try to learn by myself with a small test: It's a survey with 3 questions I would like to know if I'm using AJAX the correct way before starting bigger projects. Thanks for your ...

1 2