Skip to content

Commit e13143f

Browse files
committed
deferred tests initated
1 parent 16519c7 commit e13143f

File tree

132 files changed

+43246
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+43246
-0
lines changed

deferred.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
To change this template, choose Tools | Templates
3+
and open the template in the editor.
4+
-->
5+
<!DOCTYPE html>
6+
<html>
7+
<head>
8+
<title></title>
9+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
10+
<script type="text/javascript" src="jquery-1.6.4.js"></script>
11+
<script>
12+
/*
13+
var deferred = $.Deferred();
14+
deferred.resolve("hello world");
15+
deferred.done(function(value) {
16+
alert(value);
17+
});
18+
*/
19+
var post = $.ajax({
20+
url: "deferred",
21+
data: {json: JSON.stringify({firstName: "Jose", lastName: "Romaniello"})} ,
22+
type: "POST"
23+
});
24+
25+
post.done(function(p){
26+
alert(p.firstName + " saved.");
27+
});
28+
29+
post.fail(function(){
30+
alert("error!");
31+
});
32+
33+
</script>
34+
</head>
35+
<body>
36+
<div>jQuery Resolved</div>
37+
</body>
38+
</html>

query_deferred/ajax.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
class Connect_Database {
4+
5+
/**
6+
* private variables
7+
*/
8+
private $user;
9+
private $password;
10+
private $database;
11+
private $server;
12+
13+
14+
/**
15+
* public variables
16+
*/
17+
public $error;
18+
public $sql;
19+
public $result;
20+
21+
22+
/*
23+
* this is a constructor, a function
24+
* that loads when an object of a class is created
25+
* here constructor initializes the database connectivity variables
26+
*/
27+
function __construct($server, $user, $password, $database) {
28+
29+
$this->server = $server;
30+
$this->user = $user;
31+
$this->password = $password;
32+
$this->database = $database;
33+
34+
35+
if(!$this->connection = mysql_connect($this->server,$this->user,$this->password)) {
36+
throw new Exception('<font color="red">ERROR :: COULD NOT ESTABLISH A CONNECTION: '.mysql_error().'</font>', self::CONNECTION_ERROR);
37+
}else {
38+
if(!mysql_select_db($this->database)) {
39+
throw new Exception('<font color="red">ERROR :: COULD NOT FIND A DATABASE : '.mysql_error().'</font>', self::CONNECTION_ERROR);
40+
}
41+
}
42+
}
43+
44+
}
45+
46+
?>

query_deferred/deferred.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
To change this template, choose Tools | Templates
3+
and open the template in the editor.
4+
-->
5+
<!DOCTYPE html>
6+
<html>
7+
<head>
8+
<title></title>
9+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
10+
<script type="text/javascript" src="jquery-1.6.4.js"></script>
11+
<script>
12+
/*
13+
var deferred = $.Deferred();
14+
deferred.resolve("hello world");
15+
deferred.done(function(value) {
16+
alert(value);
17+
});
18+
*/
19+
var post = $.ajax({
20+
url: "deferred",
21+
data: {json: JSON.stringify({firstName: "Jose", lastName: "Romaniello"})} ,
22+
type: "POST"
23+
});
24+
25+
post.done(function(p){
26+
alert(p.firstName + " saved.");
27+
});
28+
29+
post.fail(function(){
30+
alert("error!");
31+
});
32+
33+
</script>
34+
</head>
35+
<body>
36+
<div>jQuery Resolved</div>
37+
</body>
38+
</html>

resources/js/jquery-1.6.4.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tdd/payment.doc

19.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)