Tagged Questions
4
votes
1answer
46 views
Script for dynamically-loading data onto a restaurant menu for printing
I have a script which dynamically loads data onto a restaurant menu for printing. Could the following code could be shortened at all?
...
2
votes
0answers
29 views
JavaScript eBay Listing Generator - revised
I posted my first attempt at this here. It's an app that generates both a preview of an interactive eBay listing, as well as the raw code which the user can copy and paste into their listing.
I got ...
3
votes
1answer
33 views
Plugin for communication protocols in browser(s)
I would like to get some feedback from the community regarding a plugin I recently moved from requiring jQuery to a stand alone JS implementation.
It is meant to handle browser communication ...
1
vote
1answer
42 views
2
votes
1answer
52 views
Simplifying AJAX success code
Please take a look at this Fiddle.
Is there a better way of building a table with titles in the first cell of each row, like this:
...
10
votes
1answer
72 views
Loading the resource identified by a script element's src attribute
I have a function to load the resource identified by a <script> element's src attribute.
I need it to:
Be as universal ...
2
votes
1answer
73 views
Refactoring a Instagram widget feed function
I've adapted a Instagram widget from this example so that it now appends 8 images to their respective IDs using a Instagram username. I want my widget implementation to be better and more efficient. ...
1
vote
0answers
44 views
JavaScript parameters - best practices for settings object/callback
I have the following function which runs as expected and is defined in the window object:
...
2
votes
2answers
78 views
6
votes
2answers
195 views
Reusable Ajax object
I've been working on a new project and I've found myself needing to make multiple Ajax calls, often on the same page and at the same time. I decided rather than repeating code that I would try and ...
13
votes
3answers
161 views
Simplifying a repetitive event handler
Is there a more efficient way of writing this? It seems like so much redundancy that this can be greatly reduced. Basically the only difference is if isNodeWebkit ...
1
vote
1answer
55 views
AJAX chat client
I have here a set of code that is used for retrieving and storing conversation for a chat application if found this from a tutorial and tweak it a little bit. This script works fine but my concern is ...
3
votes
1answer
52 views
Raw JS AJAX method
I built this as a simple example of using raw JS to perform a simple GET request with a data callback.
Suggestions on how this could be improved in any way, while keeping it simple, would be much ...
1
vote
1answer
53 views
Script for managing server IDs
I have a jQuery script and I should explain it line by line. I already do that and I want to make sure that is correct. If someone has any remarks, I will be very appreciative.
...
7
votes
1answer
115 views
Requesting Resources Until Exhaustion
When an API has a 'next' feature, I use the following pattern to obtain all the results:
...
2
votes
1answer
78 views
2
votes
3answers
373 views
How to improve this current contact form?
I have just started learning how to build websites, and I have been experimenting by creating a contact form.
Here is what I currently have - can anyone suggest and recommend ways enhance my current ...
2
votes
1answer
69 views
Compacting jQuery Code for Framebox Plugin
I have written my first jQuery plugin for a website. It is, essentially, a Fancybox style popup that uses AJAX to load content from other pages. It's kind of a frankenstein build from multiple ...
0
votes
1answer
90 views
8
votes
1answer
184 views
A package for classes and Ajax
I've built a framework that primarily provides automated Ajax and a way to emulate classes. I've pasted the framework below and I hope it is well-commented.
...
3
votes
1answer
764 views
Creating <select> element and append data to it
I've made the following and have a few questions:
Do I have some (big) mistakes in this approach? (bad practices, 'this code is trash'...)
1.1 If I do, can you suggest what to fix?
Are appended ...
4
votes
1answer
82 views
Bringing content from other pages without refreshing the entire page
I wrote my first AJAX script that brings content from other pages without refreshing the entire page. I just want to see if improvements can be added to it, or if I'm doing something not recommended.
...
0
votes
0answers
38 views
storing the data twice on the second occasion
I use php codeigniter, jquery ajax and datatables, this image is result when first save:
and this the second result when I click add button:
this my code in javascript:
...
8
votes
3answers
102 views
Fail-proof AJAX
I'm working on a page using AJAX that will get an entire .php page when the navigation button is clicked. I have that set up and working right. But this is my first time using AJAX, so I'm not sure ...
4
votes
0answers
155 views
How can I optimize this query to improve performance? [closed]
I'm building a wordpress website using advanced custom fields and the repeater plugin. I've managed to put this query together after re-organizing my data using the repeater plugin. The query below ...
0
votes
1answer
335 views
Please check my example about jquery autocomple with servlet [closed]
Please check my code, did i get some things wrong
I'm a newbie in jquery and ajax, please check and show me how to fix this
In jsp page :
...
1
vote
2answers
113 views
Creating new CSS element everytime database updates
I have created a function using jQuery Ajax which create a new CSS element whenever I update the database using a form.
Is it ok? If not, hat can be the best method to do it?
...
2
votes
2answers
154 views
PHP Application, attempting to restructure (Massive case/switch, ajax calls)
background
A little over a year ago I was given the creative freedom to develop on the side of my primary responsibilities. I want to move into development, but am not currently in that role. I was ...
6
votes
2answers
118 views
JavaScript file for a CMS application
Be as harsh as you can! I'm trying to improve my coding style and would like to know if there is anything I could improve.
EDIT: To make this fair, The person who provides the most helpful tips (both ...
2
votes
2answers
3k views
Chat with PHP, MySql, Ajax: How to improve it?
I made this simple chat in php. You have suggestions on how I can improve it?
This file configures the connection to the server
This file is a simple form "login" ( only username required )
...
3
votes
1answer
728 views
Is this simple AJAX login/register script sufficient?
I'm using Twitter Bootstrap. I haven't coded anything significant web design related in a while, because I've been doing desktop stuff and games. I'm trying to get back into the flow of things. Can ...
2
votes
1answer
337 views
Code to update content via ajax
Following is the code to update content via ajax. Please review all aspects of the code.
...
2
votes
1answer
134 views
DOM cloning in a loop
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?
...
4
votes
1answer
93 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 ...
3
votes
2answers
1k 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 ...
5
votes
3answers
266 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 ...
3
votes
1answer
132 views
Managing debit/credit accounts
I just want to know if there room for improvement or something I should redo to be better. Sorry for my lack of notes.
...
3
votes
1answer
793 views
1
vote
1answer
102 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, ...
2
votes
1answer
4k 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
...
1
vote
2answers
5k 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 ...
9
votes
2answers
1k 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
628 views
Angularjs stream ajax responses? [closed]
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
161 views
Simple cache mechanism?
In my system I frequently require data by Ajax requests. For example, different lists, content of modal dialogs, etc. This data can't be changed after request, so I wrote cache mechanism which stores ...
1
vote
1answer
111 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 ...
0
votes
2answers
951 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
1k 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> ...
3
votes
2answers
214 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 ...
2
votes
0answers
574 views
My PHP AJAX bridge to jQuery library [closed]
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
1answer
944 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 ...