background preloader

Ajax

Ajax
Description: Perform an asynchronous HTTP (Ajax) request. The $.ajax() function underlies all Ajax requests sent by jQuery. It is often unnecessary to directly call this function, as several higher-level alternatives like $.get() and .load() are available and are easier to use. If less common options are required, though, $.ajax() can be used more flexibly. At its simplest, the $.ajax() function can be called with no arguments: Note: Default settings can be set globally by using the $.ajaxSetup() function. This example, using no options, loads the contents of the current page, but does nothing with the result. The jqXHR Object The jQuery XMLHttpRequest (jqXHR) object returned by $.ajax() as of jQuery 1.5 is a superset of the browser's native XMLHttpRequest object. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). Callback Function Queues Data Types Sending Data to the Server

getJSON Description: Load JSON-encoded data from the server using a GET HTTP request. This is a shorthand Ajax function, which is equivalent to: Data that is sent to the server is appended to the URL as a query string. If the value of the data parameter is a plain object, it is converted to a string and url-encoded before it is appended to the URL. Most implementations will specify a success handler: This example, of course, relies on the structure of the JSON file: Using this structure, the example loops through the requested data, builds an unordered list, and appends it to the body. The success callback is passed the returned data, which is typically a JavaScript object or array as defined by the JSON structure and parsed using the $.parseJSON() method. As of jQuery 1.5, the success callback function receives a "jqXHR" object (in jQuery 1.4, it received the XMLHttpRequest object). Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently.

jQuery.ajax - Русская документация по jQuery Загружает удаленную страницу используя HTTP запрос. Это низкоуровневая реализация AJAX в jQuery. Для функций более высокого уровня абстракции обратитесь к $.get, $.post и т.д., которые, зачастую, легче понять и использовать, но которые все же предоставляют ограниченную функциональность по сравнению с данным методом. $.ajax() возвращает объект XMLHttpRequest. В качестве аргумента функции $.ajax() передается объект, состоящий из пар ключ/значение, которые используются для инициализации и управления запросом. Примечание: если Вы указываете опцию dataType, которая описывается в разделе «Опции» на этой странице, то убедитесь, что сервер отсылает корректный тип MIME в своем ответе (например, xml как «text/xml»). Примечание: если параметр dataType установлен в ’script’ или ‘jsonp’, то все удаленные (не в пределах одного домена) запросы должны быть указаны как запросы типа GET (поскольку скрипт загружается используя тег script модели DOM).

jQuery Gantt: Créez des diagrammes de Gantt avancés avec jQuery jQuery Gantt est un plugin permettant de créer des diagrammes de Gantt web interactifs et avancés. Si vous développez votre propre intranet de développement ou une solution de gestion de projet pour un client, cette ressource va vous rendre pas mal de services ! En effet, ce plugin jQuery vous permettra de mettre en place le fameux diagramme de Gantt facilement et rapidement configurable. Vous pouvez l'utiliser pour organiser vos sprints et disposez vos tâches par catégories, couleurs... La navigation est vraiment bien pensée, avec un système de zoom et dé-zoom pour avoir une vue plus générale des différentes tâches. Un slider vous permet d'évoluer facilement dans la chronologie du diagramme avec la souris. Sur le hover de la souris, vous pouvez afficher plus de détail sur la tâche ... Côté utilisation, le plugin se met en place rapidement et dispose de plusieurs options: 01. 02. source: "ajax/data.json", 03. scale: "weeks", 04. minScale: "weeks", 05. maxScale: "months", Site Officiel

List of Ajax frameworks This is a list of notable Ajax frameworks, used for creating web applications with a dynamic link between the client and the server. Some of the frameworks are JavaScript compilers, for generating JavaScript and Ajax that runs in the web browser client; some are pure JavaScript libraries; others are server-side frameworks that typically utilize JavaScript libraries. JavaScript[edit] JavaScript frameworks are browser-side frameworks very commonly used in Ajax development. Other frameworks not among the most used include: Java[edit] These frameworks use Java for server-side Ajax operations: C++[edit] Wt - a C++ Web Toolkit .NET[edit] The following frameworks are available for the Windows .NET platform: Perl[edit] PHP[edit] A PHP Ajax framework is able to deal with database, search data, and build pages or parts of page and publish the page or return data to the XMLHttpRequest object. Python[edit] These frameworks use Python for client-side Ajax operations: Ruby[edit] Groovy[edit] ZKGrails Scala[edit]

post Description: Load data from the server using a HTTP POST request. This is a shorthand Ajax function, which is equivalent to: The success callback function is passed the returned data, which will be an XML root element or a text string depending on the MIME type of the response. As of jQuery 1.5, the success callback function is also passed a "jqXHR" object (in jQuery 1.4, it was passed the XMLHttpRequest object). Most implementations will specify a success handler: This example fetches the requested HTML snippet and inserts it on the page. Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests. The jqXHR Object As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. Deprecation Notice The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8.

Ajax-события — JQuery Материал из JQuery Выполнение ajax-запросов сопровождается возникновением различных событий, которые могут быть обработаны с помощь пользовательских функций. На данной странице вы сможете найти список всех этих событий, а так же узнать, в каком порядке они происходят. Локальные события "Подписаться" на события этого типа можно только в настройках низкоуровнего ajax-запроса: Отметим, что установленные таким образом настройки будут действовать только для текущего запроса. Глобальные события Эти события передаются всем элементам DOM, поэтому привязка к ним происходит посредством обработчиков событий на элементах: $("#loading").bind("ajaxSend", function(){ $(this).show(); }); // или, то же самое, но с помощью специальной функции $("#loading").ajaxSend(function(){ $(this).show(); }) Глобальные события могут быть отключены с помощью параметра global в настройках ajax-запроса: Список событий

Logikey - Développement d'Applications sur Mesure Populate a select using Ajax In this post I’ll explain how to populate a select dropdownlist using jQuery and Ajax. I am using an ASP.NET web application and page methods to perform the Ajax calls. Using page methods means that you do not need a seperate web service, which is good if the functionality is specifically for the page. The page methods must be declared public static and use the WebMethod attribute. Download source First of all here is the contents of my form with two select lists, one for gender and one for names. Gender Name Here is the page method that gets my list of genders: [WebMethod] public static ArrayList GetGenders() return new ArrayList() new { Value = 1, Display = "Male" }, new { Value = 2, Display = "Female" } For the purpose of the example I am just returning an ArrayList of an anonymous type containing a value and display text which will be converted to JSON in jQuery and used to populate the select list. Here is the method used to get the list of names based on the selected gender. else $.ajax({

SQL.ru - все про SQL, базы данных, программирование и разработку информационных систем RESTful web services + Spring 3 MVC HttpMessageConverter feature Introduction A companion article, "Build RESTful web services using Spring 3," (see Resources) introduced the "Spring way" to build RESTful web services. It also explained how to use ContentNegotiatingViewResolver to produce multiple representations, which is an important feature for RESTful web services. This article explains another way to produce multiple representations using HttpMessageConverter, and examples in the article show how to use RestTemplate with HttpMessageConverter to communicate with services. Back to top REST support in Spring MVC This section provides an overview of the major Spring features, or annotations, that support RESTful web services. @Controller Use the @Controller annotation to annotate the class that will be the controller in MVC and handle the HTTP request. @RequestMapping Use the @RequestMapping annotation to annotate the function that should handle certain HTTP methods, URIs, or HTTP headers. For example: @PathVariable Other useful annotations Table 1. ATOM feed

Related: