Questions tagged [ajax]

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

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

184 questions
83
votes
12 answers

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 data transfer formats such as XML (and say "oooh…
Christopher Francisco
  • 2,392
  • 1
  • 12
  • 27
55
votes
2 answers

When not to use Google Web Toolkit?

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 team reduce the size of tech stack by one. …
Jas
  • 6,254
  • 1
  • 31
  • 46
48
votes
6 answers

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 non-blocking. It's an AJAX request made without…
Reactgular
  • 13,040
  • 4
  • 48
  • 81
42
votes
8 answers

How do I get started with HTML5?

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 development" is in fact a mixture of HTML, CSS, JS…
daniel.sedlacek
  • 902
  • 1
  • 10
  • 20
30
votes
5 answers

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 servers (rather than web browsers) enforce it. From…
rgb
  • 879
  • 2
  • 8
  • 18
27
votes
1 answer

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 for requests that are Request/Response and not real…
Marc
  • 535
  • 2
  • 5
  • 11
24
votes
1 answer

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 song, it is called Susy, for example. Where we…
dt0xff
  • 339
  • 1
  • 2
  • 6
21
votes
12 answers

How to talk a client out of a Flash website?

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 terrible, and do not hate dealing with UI like many…
bunglestink
  • 2,262
  • 16
  • 26
19
votes
1 answer

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 want to scale well up to 1000 users or so.…
mattinsalto
  • 336
  • 1
  • 2
  • 9
16
votes
5 answers

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 create a full view and pass this back to the browser…
eyeballpaul
  • 339
  • 1
  • 2
  • 4
14
votes
3 answers

When to use REST to handle requests vs using AJAX to handle requests

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 I really don't get the difference between REST…
Kaushik
  • 1,195
  • 3
  • 12
  • 20
13
votes
3 answers

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 request would be sent to the database, via…
goodsquishy
  • 347
  • 2
  • 3
  • 8
12
votes
1 answer

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 applications become heavier on the Ajax side…
cbrandolino
  • 1,999
  • 1
  • 18
  • 21
10
votes
8 answers

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 and I keep up with as much as I can. But this…
AAA
  • 313
  • 1
  • 3
  • 9
10
votes
4 answers

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 server-side code rulled. A server had to route…
Joe
  • 481
  • 5
  • 12
1
2 3
12 13