Skip to main content

Questions tagged [ajax]

AJAX (Asynchronous Javascript And XML) is a popular technique for creating interactive websites.

Filter by
Sorted by
Tagged with
83 votes
12 answers
57k views

What's actually wrong with an endpoint returning HTML rather than JSON data?

When I first started learning PHP (about 5 or 6 years ago) I learned about Ajax, and I went through "the phases": Your server returns HTML data and you put it inside a DOM's innerHTML You learn about ...
Christopher Francisco's user avatar
55 votes
2 answers
33k views

When not to use Google Web Toolkit? [closed]

I'm considering use of GWT on a major in-house web app development project, namely it's major advantage in my eyes is the cross-compilation to Javascript which would (at least theoretically) help my ...
Jas's user avatar
  • 6,323
47 votes
6 answers
7k views

How safe are hidden AJAX requests that fake performance?

What is a hidden AJAX request? I've noticed an increase in the usage of hidden AJAX requests designed to make a user's action appear to happen immediately. I'll refer to this type of AJAX request as ...
Reactgular's user avatar
  • 13.1k
42 votes
8 answers
7k views

How do I get started with HTML5? [closed]

What is the recommended workflow to learn HTML5? What tools should I install? What SDK? Where to start? How to test? How to debug? What do I read? I understand that what is often labelled as "HTML5 ...
daniel.sedlacek's user avatar
32 votes
5 answers
12k views

How do web servers enforce the same-origin policy?

I'm diving deeper into developing RESTful APIs and have so far worked with a few different frameworks to achieve this. Of course I've run into the same-origin policy, and now I'm wondering how web ...
rgb's user avatar
  • 909
27 votes
1 answer
22k views

RESTful HTTP and websocket in the same application?

If an application has already an opened WebSocket for live feeds, should I use it over AJAX for the other communications with the server? Because the connection is already opened, should we use it ...
Marc's user avatar
  • 545
24 votes
1 answer
23k views

Nested REST urls and parent id, which is better design?

Okay, we have two resources: Album and Song. Here is API: GET,POST /albums GET,POST /albums/:albumId GET,POST /albums/:albumId/songs GET,POST /albums/:albumId/songs/:songId We know that we hate some ...
dt0xff's user avatar
  • 339
21 votes
12 answers
2k views

How to talk a client out of a Flash website? [closed]

I have recently been doing a bunch of web side projects through word of mouth recommendations only. Although I am much more a of a programmer than a designer by any means, my design skills are not ...
bunglestink's user avatar
  • 2,262
20 votes
1 answer
16k views

Many asynchronous calls vs single call to the API

We are developing a REST API which among others is going to be consumed by an HTML5 frontend via javascript. The application is for use within the organization and usually has about 300 users, but we ...
mattinsalto's user avatar
16 votes
5 answers
16k views

Pure Front end JavaScript with Web API versus MVC views with ajax

This was more a discussion for what peoples thoughts are these days on how to split a web application. I am used to creating an MVC application with all its views and controllers. I would normally ...
eyeballpaul's user avatar
14 votes
3 answers
61k views

When to use REST to handle requests vs using AJAX to handle requests [closed]

On my web page, if I wish to display dynamic dropdowns (e.g city names based on country selected), I can do it using AJAX. But I can also do it using a REST call. So which should I use? My problem is ...
Kaushik's user avatar
  • 1,195
14 votes
3 answers
16k views

What are best practices for caching paginated results whose ordering/properties can change?

What is the best practice for caching paginated search results whose ordering/properties can be changed? Say, in my application, someone wants to see the last 20 discussion threads (out of 10,000). A ...
goodsquishy's user avatar
12 votes
1 answer
2k views

Patterns for ajax-heavy web applications

Up until now, I've been a great fan of the MVC pattern for developing web applications. For the web, I've developed mostly in PHP (with the Kohana and CodeIgniter frameworks) and Ruby (RoR). As my ...
cbrandolino's user avatar
  • 1,999
10 votes
8 answers
23k views

Is it necessary to memorize code?

I am a new developer, who just got hired at a big company. I don't know how but I guess they are desperate. However, I am well-versed with HTML5/CSS3 though things change and new things are released ...
AAA's user avatar
  • 313
10 votes
4 answers
6k views

Does business logic really belong on the server?

A typical stack for a web application is a database, a server with server-side code, and a user with a browser with HTML/CSS/JavaScript. Before extensive AJAX, MVC in which the controller was the ...
Joe's user avatar
  • 481
10 votes
6 answers
5k views

Would using AJAX extensively improve server performance?

Clearly AJAX improves the user interface but does this also decrease server load? You would think it does because the entire page will not have to be served up each time, but maybe there are other ...
coder's user avatar
  • 2,019
9 votes
3 answers
6k views

Ajax race conditions

Is there a pattern or standard way to handle Ajax race conditions? Take the following example. You have two tables. Clicking a row on table 1 removes the data from DB and then updates table 2 (which ...
Ominus's user avatar
  • 1,879
9 votes
3 answers
4k views

Proper Response to HTTP Request When Too Much Data is Requested

I'm building an API for an ad serving platform that will allow you to request tracker data for ad campaigns. Campaigns often exceed hundreds of millions of requests, which means there will be many ...
Griffin's user avatar
  • 507
9 votes
1 answer
1k views

Who first created or popularized the original XMLHTTPRequest / MSXML?

I'm trying to understand the origins of AJAX, and think MSXML and XMLHTTPRequest were the objects that started it all. Which came first, and/or became the defacto way to create dynamic pages?
makerofthings7's user avatar
9 votes
1 answer
4k views

How should I handle a redirect to an identity provider during a web api data request

Scenario I have a single-page web app consisting purely of html, css, and javascript. After initial load and during use, it updates various views with data from one or more RESTful apis via ajax ...
Erds's user avatar
  • 193
8 votes
3 answers
598 views

Is maintaining Heavily Ajax-Based Web Apps more difficult?

Maybe I'm doing it wrong, but in my experience, developing and maintaining heavily ajax-based web apps is much more difficult then a "more standard" web app. I'm not talking about an app that uses ...
Erik's user avatar
  • 508
7 votes
9 answers
4k views

Is it worth Learning XML as a web developer when JSON is better for AJAX? [duplicate]

Is it worth Learning XML as a web developer when JSON is better for AJAX? or is it better to concentrate on JSON/Javascript for AJAX?
Imran's user avatar
  • 433
7 votes
6 answers
24k views

Securing ajax calls to rest api

I need for my app to consume a rest api service and since I will call it from javascript/jquery i need to expose it to the end user. In this case I would also need to expose credentials to the end ...
John's user avatar
  • 773
7 votes
2 answers
5k views

Image resizing client side vs server side

When uploading a lot of images to a server, to minimize the space taken by the images, is it better to resize the images before sending to the server or upon receiving them? It seems to me that ...
Alex's user avatar
  • 173
7 votes
6 answers
9k views

Triggering custom events in AJAX callbacks

I'm pretty new to JavaScript, but one of the things that's been frustrating is that our AJAX callbacks have been getting packed with different functionality, making it difficult to keep everything ...
Sabrina Gelbart's user avatar
6 votes
5 answers
525 views

ASP.NET AJAX and my axe!

So, I'm seriously considering axing ASP.NET AJAX from my future projects as I honestly feel it's too bloated, and at times convoluted. I'm also starting to feel it is a dying library in the .NET ...
Marlon's user avatar
  • 1,153
6 votes
4 answers
6k views

What to call pure JavaScript standalone (web)apps for which I've not written any server side code? [closed]

I've been writing a few tools as standalone webapps for which I have written no server side code and it strikes me that I'm not sure what people call such things. I like them because they can be ...
hippietrail's user avatar
6 votes
2 answers
1k views

How does "new message" notification work?

I'm interested to know the implementation of the 'new message' in gmail for example. I know that ajax is used, but what else it is used on the server and client side. Can you explain me the scenario? ...
dole doug's user avatar
  • 197
6 votes
3 answers
3k views

Should jQuery DOM manipulation be avoided in favor of JavaScript template engines?

From what I can tell, most developers will use heavy jQuery DOM manipulation tactics to deliver their updated AJAX views. Once things get out of hand, they may consider refactoring using template ...
Jason Rikard's user avatar
6 votes
2 answers
2k views

How can I design an efficient moderation system for comments?

Here's the job I want to do: My project is a website where there will be a lot of comments. Those comments will be moderated: a moderator will connect, see comments and accept or refuse them. I need ...
Olivier Pons's user avatar
5 votes
9 answers
1k views

A friend wants some FREE CRUD code [closed]

A 'friend' of mine asked me to write a complete CRUD system with AJAX for him for free. What should I do? Technically, its bread and butter for me. However, I am wondering if I should get paid for it. ...
mahen23's user avatar
  • 1,110
5 votes
4 answers
2k views

Do i need to know how Ajax works since Asp.net provides me UpdatePanel [closed]

I am working on Asp.net webform and it already provides me ready to user Ajax solution by using an update panel, so should I invest my time learning how Ajax really work ?
Sarawut Positwinyu's user avatar
5 votes
1 answer
565 views

Is there a name for web applications that do most of the navigation on the client side?

Does the web industry have any standard or common name that refers specifically to web applications that don't use the conventional window-HTTP-navigation model, instead relying on mostly or wholly on ...
Nicole's user avatar
  • 28.2k
5 votes
2 answers
663 views

I'm using JSON and degrading gracefully, so how do I prevent duplicate code?

There are a bunch of questions on Stack Overflow about whether AJAX should return JSON or HTML, and most seem to agree that it is ideal to return JSON for the sake of speed. However, that means that ...
juicy lucy's user avatar
5 votes
2 answers
1k views

Better to send all data to client or query server for every search?

I have a search function on my site that needs to search through ~2000 items (this table never changes, it will always have the same number of items) stored in MySQL. All it needs to do is search by ...
obl's user avatar
  • 159
5 votes
5 answers
16k views

How much AJAX is too much?

My current project is part of a highly linked architecture, with individual systems each owning certain pieces of data, and exposing them RESTfully. Both our web services and our user interface take ...
CPhelps's user avatar
  • 93
5 votes
6 answers
2k views

when to load partial views

When creating a website, when should you load partial view and when should you do a complete page refresh? I was looking at github's site and noticed that pretty much the only place they do partial ...
asawilliams's user avatar
4 votes
3 answers
2k views

Is dynamic HTML layout good from an SEO perspective?

Just wondering whether dynamically built HTML layout is fine from SEO perspectives? So let's assume e-commerce engine and its most popular page - products catalog. So 90% of the page is built using ...
sll's user avatar
  • 421
4 votes
2 answers
4k views

Managing session timeouts with regards to user activity in the page

So I will be creating a feature to a php application that does the following: Create a session that expires after 30 minutes. After 30 minutes, if there is no user activity in the application (...
lightning_missile's user avatar
4 votes
2 answers
1k views

Do ASP.Net Web Forms actually produce ADA compliant HTML? Does the ASP/AJAX toolkit undermine the goal of ADA compliance?

I'm trying to convince my employer to let us use the Microsoft ASP/AJAX toolkit since it simplifies the implementation of many controls. However they have rejected the idea on the grounds that it ...
ConditionRacer's user avatar
4 votes
4 answers
4k views

Easiest way to create static HTML file with sortable and filterable table?

I want to create a static HTML file I can email to someone with a lot of data, and have that data sortable and filterable. What is the easiest to use library or package I can use to get this off the ...
sooprise's user avatar
  • 1,075
4 votes
2 answers
4k views

Should we (still) consider a synced XMLHTTPRequest bad practice?

As you may know, XMLHTTPRequest can be used synchronously or asynchronously, but synchronized requests have always been considered bad practice, and I've always agreed with that. Not only is the ...
shabunc's user avatar
  • 2,454
4 votes
3 answers
2k views

how should I handle server error during ajax logout?

I need to write a handler for server error during user logout. What is a common practice? ajax.post({ url: '/auth/logout' }).done(function (response) { switch (response.statusCode) { ...
Max Koretskyi's user avatar
4 votes
1 answer
295 views

I read Pro ASP .NET MVC 2 Framework - anything else for AJAX in MVC 2?

I read Pro ASP .NET MVC 2 Framework to try and learn the ASP .NET MVC Framework, but I'm really struggling with Ajax in MVC even after going over that chapter again and again. I seem to have a decent ...
Ethel Evans's user avatar
  • 5,319
4 votes
1 answer
1k views

Risks of AJAX calls to ASMX

Currently working on an ajax call to an ASP web service (.asmx). In a situation where I POST to the url/.asmx/WebMethod, am I exposing information of any kind? In the 'WebMethod' I am running a ...
terbubbs's user avatar
  • 155
4 votes
2 answers
1k views

Avoid Initial AJAX Call for Loading Data

Here is the typical sequence of events when someone navigates to a page in my application: The user navigates to my application, including URL parameters and query strings. The server receives the ...
Travis Parks's user avatar
  • 2,533
4 votes
2 answers
1k views

How to validate ajax request comes from correct page and is not tampered with?

I am building a simple Q&A app with PHP, HTML and JS. I have three tables: users,question and answers, each table has it's own primary key and questions and answers both have foreign key ...
The Law's user avatar
  • 255
4 votes
1 answer
319 views

AJAX IRCX Client and Server

I am currently developing an IRCX AJAX Chat Based system and have a few questions regarding the Server and Client implementation. Any suggestions are welcome: Server: Should this be implemented as a ...
Darren's user avatar
  • 153
4 votes
2 answers
2k views

Spring MVC - Handling validation errors using AJAX

I'm new to Spring MVC, hence the question may appear trivial. I have a login form which is submitted via ajax and in return I receive a ModelAndView (displaying existing list of contacts of the user) ...
Abhigyan Mehra's user avatar
4 votes
2 answers
1k views

Displaying items with a countdown timer

I am creating a widget for rotating topics. The functionality is as follows: Each topic is displayed one by one on the homepage and has a duration of 30 seconds. A countdown timer is displayed on the ...
MAX POWER's user avatar
  • 179