SlideShare a Scribd company logo
@vinhnv
$.ajax ({
type: 'POST',
url: SERVER.baseUrl + '/base/index/error?ajax‘,
data: {},
complete: function ( jqXHR, textStatus ) {
var responseObj = $.parseJSON(jqXHR.responseText);
},
error: function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR, textStatus, errorThrown, arguments.callee);
},
success: function (data, textStatus, jqXHR) {
var responseObj = $.parseJSON(data);
}});
NOTE:
- add your param to callback
- util Jquery.param
- Jquery. serialize

@vinhnv
$(formSelector).ajaxSubmit({
data: {}, // must be object
success: function (data, textStatus, jqXHR, element) {
var responseObj = responseObj = $.parseJSON(data);
},
error: function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR, textStatus, errorThrown, arguments.callee);
},
});
NOTE:
response text from server that not contains any html tag
Tag form must contains attribute:
› method="post“
› enctype="multipart/form-data"

@vinhnv
http://api.jquery.com/jQuery.ajax
http://malsup.com/jquery/form

@vinhnv

More Related Content

PDF
DEV Čtvrtkon #76 - Fluent Interface
KEY
Cakephp2study tips集
PDF
Higher-Order Components — Ilya Gelman
TXT
PDF
Laravel, the right way - PHPConference 2016
PDF
10 Lessons Learned from using Kafka in 1000 Scala microservices - Scalar Online
PDF
Feeds drupal cafe
PPTX
Elixir flow: Building and tuning concurrent workflows
DEV Čtvrtkon #76 - Fluent Interface
Cakephp2study tips集
Higher-Order Components — Ilya Gelman
Laravel, the right way - PHPConference 2016
10 Lessons Learned from using Kafka in 1000 Scala microservices - Scalar Online
Feeds drupal cafe
Elixir flow: Building and tuning concurrent workflows

What's hot (19)

PDF
Михаил Крайнюк. Form api: ajax-commands
PDF
Angular promises and http
PPTX
Angular 1.x vs. Angular 2.x
PPTX
Angular 2 Architecture
PDF
WordPress REST API: Expert Advice & Practical Use Cases
PDF
COMP2021 Final Project - LightHTML
PPTX
SPFx working with SharePoint data
PPTX
SPFx: Working with SharePoint Content
PPTX
22.sessions in laravel
PPTX
Template syntax in Angular 2.0
PDF
PHP 8.1: Enums
PDF
Designing Immutability Data Flows in Ember
PDF
Perl6 operators and metaoperators
PPTX
Component lifecycle hooks in Angular 2.0
PDF
Drupal Field API. Practical usage
PDF
Angular server-side communication
DOCX
exportDisabledUsersRemoveMailbox
KEY
Symfony2 Building on Alpha / Beta technology
KEY
第49回Php勉強会@関東 Datasource
Михаил Крайнюк. Form api: ajax-commands
Angular promises and http
Angular 1.x vs. Angular 2.x
Angular 2 Architecture
WordPress REST API: Expert Advice & Practical Use Cases
COMP2021 Final Project - LightHTML
SPFx working with SharePoint data
SPFx: Working with SharePoint Content
22.sessions in laravel
Template syntax in Angular 2.0
PHP 8.1: Enums
Designing Immutability Data Flows in Ember
Perl6 operators and metaoperators
Component lifecycle hooks in Angular 2.0
Drupal Field API. Practical usage
Angular server-side communication
exportDisabledUsersRemoveMailbox
Symfony2 Building on Alpha / Beta technology
第49回Php勉強会@関東 Datasource
Ad

Viewers also liked (17)

PDF
STA Newsletter Ops Committee 10.15
PDF
ii The Interpreter - Személyi tolmács a telefonodon!
PPT
Epigenetics /certified fixed orthodontic courses by Indian dental academy
PPTX
Presentacion1
DOCX
Segunda fase
PPTX
Dogs for çuuem
PPTX
мовчан.я.в. мо кл_керівників
PDF
2.7.4 Conditions for Parallelograms
DOCX
PDS mentorship and employee development program
PDF
Van plan naar zaak - Creative Entrepreneurship Sessions #2
PPT
Eruptive abnormalities and their treatment /certified fixed orthodontic cours...
PPT
Esthetic orthodontic brackets /certified fixed orthodontic courses by Indian ...
PPT
Esthetic orthodontics /certified fixed orthodontic courses by Indian dental a...
PPT
Eruptive anomalies /certified fixed orthodontic courses by Indian dental acad...
PDF
MWC_GA_101
PPT
Eruption problems /certified fixed orthodontic courses by Indian dental academy
STA Newsletter Ops Committee 10.15
ii The Interpreter - Személyi tolmács a telefonodon!
Epigenetics /certified fixed orthodontic courses by Indian dental academy
Presentacion1
Segunda fase
Dogs for çuuem
мовчан.я.в. мо кл_керівників
2.7.4 Conditions for Parallelograms
PDS mentorship and employee development program
Van plan naar zaak - Creative Entrepreneurship Sessions #2
Eruptive abnormalities and their treatment /certified fixed orthodontic cours...
Esthetic orthodontic brackets /certified fixed orthodontic courses by Indian ...
Esthetic orthodontics /certified fixed orthodontic courses by Indian dental a...
Eruptive anomalies /certified fixed orthodontic courses by Indian dental acad...
MWC_GA_101
Eruption problems /certified fixed orthodontic courses by Indian dental academy
Ad

Similar to Jquery ajax & form (20)

PDF
Building Evented Single Page Applications
PDF
Building evented single page applications
PDF
Stop Making Excuses and Start Testing Your JavaScript
PDF
React 101
KEY
JavaScript Testing for Rubyists
PDF
What's new in jQuery 1.5
PDF
Rails is not just Ruby
PDF
Creating a Facebook Clone - Part XXVII.pdf
PDF
Simplify AJAX using jQuery
PDF
Silex meets SOAP & REST
PPTX
JQuery Presentation
DOCX
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
PDF
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
PDF
Jason parsing
PDF
Jquery ajax post example
PDF
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...
PDF
Avinash Kundaliya: Javascript and WordPress
KEY
Sexy.js: A Sequential Ajax (Sajax) library for jQuery
PDF
jQuery secrets
Building Evented Single Page Applications
Building evented single page applications
Stop Making Excuses and Start Testing Your JavaScript
React 101
JavaScript Testing for Rubyists
What's new in jQuery 1.5
Rails is not just Ruby
Creating a Facebook Clone - Part XXVII.pdf
Simplify AJAX using jQuery
Silex meets SOAP & REST
JQuery Presentation
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Jason parsing
Jquery ajax post example
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...
Avinash Kundaliya: Javascript and WordPress
Sexy.js: A Sequential Ajax (Sajax) library for jQuery
jQuery secrets

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
A Presentation on Artificial Intelligence
PPTX
Spectroscopy.pptx food analysis technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A comparative analysis of optical character recognition models for extracting...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Unlocking AI with Model Context Protocol (MCP)
The AUB Centre for AI in Media Proposal.docx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The Rise and Fall of 3GPP – Time for a Sabbatical?
sap open course for s4hana steps from ECC to s4
A Presentation on Artificial Intelligence
Spectroscopy.pptx food analysis technology
Review of recent advances in non-invasive hemoglobin estimation
Programs and apps: productivity, graphics, security and other tools
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Spectral efficient network and resource selection model in 5G networks

Jquery ajax & form

  • 2. $.ajax ({ type: 'POST', url: SERVER.baseUrl + '/base/index/error?ajax‘, data: {}, complete: function ( jqXHR, textStatus ) { var responseObj = $.parseJSON(jqXHR.responseText); }, error: function (jqXHR, textStatus, errorThrown) { console.log(jqXHR, textStatus, errorThrown, arguments.callee); }, success: function (data, textStatus, jqXHR) { var responseObj = $.parseJSON(data); }}); NOTE: - add your param to callback - util Jquery.param - Jquery. serialize @vinhnv
  • 3. $(formSelector).ajaxSubmit({ data: {}, // must be object success: function (data, textStatus, jqXHR, element) { var responseObj = responseObj = $.parseJSON(data); }, error: function (jqXHR, textStatus, errorThrown) { console.log(jqXHR, textStatus, errorThrown, arguments.callee); }, }); NOTE: response text from server that not contains any html tag Tag form must contains attribute: › method="post“ › enctype="multipart/form-data" @vinhnv