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.
7
votes
3answers
310 views
I'm working on my own JS-lib and I need someone to help.
My own CMS is currently using J-Query but as one of the goals is to have the whole project to be very small, so I've decided to write my own basic library, I only really need to select elements and ...
7
votes
3answers
294 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 ...
7
votes
2answers
21k views
Basic Simple Asp.net + jQuery + JSON example
Earlier this year, before I learnt about Code Review StackExchange, I gave this answer in response to a question about how to combine ASP.net, jQuery, and JSON: ...
6
votes
3answers
457 views
Writing a jQuery widget: Templating
I'm doing my first major jQuery development. It's a Widget for recurring events, and is as such a fairly complex beast. The full code is available at ...
6
votes
1answer
247 views
jQuery Lifestream Plug-in
This is a plug-in which tracks your online activity aka a lifestream. You're currently able to use feeds like:
Delicious
Flickr
Github
Google Reader
Last.fm
Stackoverflow
Twitter
Youtube
At first ...
5
votes
1answer
1k views
jQuery password confirmation
I have built a "reset and confirm password" section on a site. It works great. I just have this suspicion that maybe it isn't the most efficient way. I am relatively new to
jQuery but I can usually ...
5
votes
2answers
267 views
Is there a better way to write this pagination plugin?
This plugin is written in Jquery and is made to support the codeigniter framework.
It is an ajax powered table pagination plugin designed to provide only that.
You should be able to use almost any ...
5
votes
0answers
169 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 ...
4
votes
3answers
116 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: ...
4
votes
1answer
2k views
How to exactly work with the JSON Object and jQuery, adding info to posts
I have been working with AJAX and JSON for quite some years now, but to be honest I still do not know exactly what all the functionality are, and how to create optimized code for jQuery.
So my first ...
4
votes
1answer
282 views
My jquery, ajax, php scripts and files, room for improvement on ajax form validation?
Ok this is my first ever attempt at ajax form validation, and everything works as expected, the final true example will hold alot more input fields than in my testing scripts which are below.
The ...
3
votes
2answers
147 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 ...
3
votes
2answers
202 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.
...
3
votes
1answer
497 views
How would you rate this python code? (Django AJAX)
This code comes straight out from the example code in a Django book. I find it quite bad, mainly because the use of flags (if ajax then again if ajax) and unnecessarily bigger variable scope (set ...
3
votes
1answer
46 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 ...
3
votes
1answer
206 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 ...
3
votes
2answers
473 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 ...
3
votes
1answer
173 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 {
...
3
votes
1answer
172 views
JavaScript/PHP file uploader
I'm writing a JavaScript/PHP file uploader and I want to start this project off on the right track. I've started with this, a JavaScript Uploader object which will handle Ajax calls, display progress, ...
3
votes
0answers
220 views
Theme/skin swap… version 2! (CSS-driven)
I basically have an AJAX-fetched skin (html/css) that's loaded into a dummy element (id=SkinContainer) when the page is loaded, and then the content of one of its divs (contentdiv) is fetched with ...
2
votes
2answers
436 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" ...
2
votes
2answers
74 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
584 views
Test my skin/theme swap! Thoughts/comments?
Theme-swap functionality will be done via a better-looking div at the top of the page, but for right now, it's just thrown on the button. The theme preference should persist through page refreshes ...
2
votes
2answers
285 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 ...
2
votes
2answers
198 views
Fetching data via jquery and adding items to a list
Super-duper javascript noob here. I'm trying to fetch public repos from GitHub, and add them to a dl. I know this won't work on every website due to cross-site scripting, but GitHub offers a JSON-P ...
2
votes
1answer
74 views
Improve Jquery ajax response
this way I handle ajax response:
success: function (json) {
$.each(json, function(index,item){
if (item.field == "article_id") {
...
2
votes
2answers
182 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 ...
2
votes
1answer
180 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
1answer
322 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
1answer
1k views
AJAX call in JavaScript
I know there is a lot of libraries with this built in $.get() etc... but as for writing this in pure JavaScript how does this look?
var get_request;
ajaxRequest(function() {
var activexmodes, i, ...
2
votes
1answer
5k views
Suggestions for JQGrid Dynamic Columns and Server-Side paging ,sortin , filtering etc.
I have a requirement where I need to build a grid with dynamic columns. I am dealing with a large dataset so I would like to use server-side paging,sorting,filtering logic so that I render only a ...
2
votes
1answer
440 views
Polling script to determine the continuous time a user has been connected
I've been asked to keep track of how long a user has been connected to a site without interruption.
So far the solution I've come up with is to use ajax to poll the site every now and then to check ...
2
votes
1answer
52 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 () {
...
2
votes
1answer
73 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 ...
2
votes
1answer
102 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
1answer
199 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
0answers
91 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 ...
2
votes
0answers
92 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 ...
1
vote
2answers
122 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.
...
1
vote
1answer
286 views
How can I make this Javascript (jQuery, jQuery-UI, AJAX) code better?
There's things I know about Javascript and jQuery, and things I don't. I know that this works, gets and stores what I want so that, when I need to do stuff, I don't have to wait for it. Functionally, ...
1
vote
2answers
62 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 ...
1
vote
2answers
68 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
372 views
Cleaning up & better AJAX response
I'm running the below script on a WordPress powered site. It's very heavy on the animations and uses AJAX to fetch posts and load them into a div.
Three things I wanted to address:
Cleaning up the ...
1
vote
2answers
84 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 ...
1
vote
1answer
33 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 ...
1
vote
2answers
321 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 ...
1
vote
2answers
138 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 ...
1
vote
1answer
265 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
1answer
439 views
mixed AJAX/Javascript form validation check
I've got a form, for which the "Send" button should only be available, upon each form field being validated. For most of my check, I call a function checkFormValue() which is a function gathering all ...
1
vote
1answer
34 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 ...

