Skip to content

Commit 020da2d

Browse files
committed
none
1 parent 1e7e53f commit 020da2d

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

jquery_deferred/ajax.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
if((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')) {
44
//var_dump($_POST);
5-
print json_encode(array("firstName"=>'its-true'));
6-
5+
print json_encode(array("firstName"=>'its-true'));
6+
//$json_obj = json_decode($_POST['json']);
7+
//print $json_obj->firstName;
8+
}else {
9+
echo'I got my eyes on you.';
710
}
811

912

jquery_deferred/deferred.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,20 @@
3939
json: JSON.stringify({firstName: "Jose", lastName: "Romaniello"})
4040
}
4141
).pipe(function(p){
42-
return "Saved " + p.firstName;
42+
//return "Saved " + p.firstName;
43+
});
44+
post.done(function(r){
45+
alert(r);
4346
});
44-
45-
post.done(function(r){ alert(r); });
4647

4748
});
4849
</script>
4950
</head>
5051
<body>
51-
<div>jQuery Resolved</div>
52+
<div id="mother-div">
53+
jQuery Resolved
54+
http://joseoncode.com/2011/09/26/a-walkthrough-jquery-deferred-and-promise/
55+
http://www.erichynds.com/jquery/using-deferreds-in-jquery/
56+
</div>
5257
</body>
5358
</html>

0 commit comments

Comments
 (0)