Skip to main content

Bug Tracker

Side navigation

#337 closed enhancement (fixed)

Opened November 01, 2006 12:33PM UTC

Closed November 11, 2006 12:08PM UTC

Last modified June 20, 2007 01:45AM UTC

More consistent/feature rich ajax programming model

Reported by: Andrey Skvortsov Owned by:
Priority: critical Milestone:
Component: ajax Version:
Keywords: Cc:
Blocked by: Blocking:
Description

Please,see discussion

http://jquery.com/blog/2006/10/13/minor-api-change-in-102/#comment-3582

http://jquery.com/blog/2006/10/27/jquery-103/#comment-3736

I'm missing about xmlhttp object almost every time I use $.get/post/load etc.,particularly if I work with xml data."state" methods-"success"/"complete"/"error" would be useful for other ajax methods beside of generic $.ajax().

Thanks.

Attachments (0)
Change History (3)

Changed November 08, 2006 04:21PM UTC by joern comment:1

milestone: 1.0
priority: majorcritical
version: 1.0

Rather then enhancing get/post, I'd deprecate them both and promote more use of $.ajax. It uses "GET" as default, therefore $.get is redundant anyway. get and post automatically encode their data paramter, $.ajax does not. The "encoding" is the same for both get and post, so this could be moved to $.ajax, but not without an API change.

load() automatically inserts the loaded stuff into the DOM, is there really a usecase where load() needs access to the response object?

Changed November 10, 2006 04:10PM UTC by Andrey Skvor comment:2

Maybe,this will work...but $.post/get are simply convenient wrappers for $.ajax without "method" argument anyway,but responseXml must be available IMHO(in success/error too,not only in complete).load() need to access response object in case of chained/sequential/dependent processing(load,...,...),same as JQuery processing model itself.

Changed November 11, 2006 12:08PM UTC by joern comment:3

resolution: → fixed
status: newclosed

Fixed in SVN: The callback for load() gets the responseText as first parameter, the status as second and the actualy response as third parameter.

Any limitations mentioned for $.get and $.post won't fix, because those are just convenience methods for special cases.

Due to some refactorings to the AJAX module, it is now possible to pass a key/value object to $.ajax, it gets converted into a query string if it isn't a string already.

Expect a new feature in jQuery 1.1: Global settings for $.ajax that allow more then one request to reuse the same settings.