Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
Version Bump
Killing AJAX
  • Loading branch information
kenwheeler committed Feb 6, 2015
1 parent 41f150f commit 9048421
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 107 deletions.
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@ $(DOM elements) // => collection
$(HTML) // => collection
```

### $.ajax

Initiates an AJAX request with the given options and triggers the appropriate
callback.

```js
$.ajax(options)
```

##### Options

* type : String- ie: 'POST', 'GET'
* url : String- The target url
* data - Serialized data or object
* success(response) : Function- Success callback
* error : Function Error callback

### $.each

Iterates through a collection and calls the callback method on each.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cash",
"main": ["dist/cash.min.js", "dist/cash.js"],
"version": "0.0.3",
"version": "1.0.0",
"homepage": "https://github.com/kenwheeler/cash",
"authors": [
"Ken Wheeler <[email protected]>"
Expand Down
27 changes: 0 additions & 27 deletions dist/cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,6 @@
}));
};

cash.ajax = function (options) {
var request = new XMLHttpRequest();

request.open(options.type, options.url, true);

request.onload = function () {
if (request.status >= 200 && request.status < 400) {
if (options.success) {
options.success.call(this, request.responseText);
}
} else {
if (options.error) {
options.error.call(this, request.statusText);
}
}
};

request.onerror = function () {
if (options.error) {
options.error.call(this, request.statusText);
}
};

request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
request.send(options.data || "");
};

var notWhiteMatch = /\S+/g;

fn.extend({
Expand Down
2 changes: 1 addition & 1 deletion dist/cash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "cash-dom",
"version": "0.0.3",
"version": "1.0.0",
"description": "An absurdly small jQuery alternative for modern browsers.",
"main": "./dist/cash.js",
"repository": {
"type": "git",
"url": "https://github.com/hackbone/cash.git"
"url": "https://github.com/kenwheeler/cash.git"
},
"author": "Ken Wheeler <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/hackbone/cash/issues"
"url": "https://github.com/kenwheeler/cash/issues"
},
"homepage": "https://github.com/hackbone/cash",
"homepage": "https://github.com/kenwheeler/cash",
"scripts": {
"build": "gulp",
"test": "gulp test"
Expand Down
3 changes: 1 addition & 2 deletions src/_wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
root.cash = root.$ = factory();
}
})(this, function() {

var doc = document,
win = window,
ArrayProto = Array.prototype,
Expand All @@ -16,7 +16,6 @@

// @include ./core.js
// @include ./util.js
// @include ./ajax.js
// @include ./attributes.js
// @include ./collection.js
// @include ./css.js
Expand Down
26 changes: 0 additions & 26 deletions src/ajax.js

This file was deleted.

1 change: 0 additions & 1 deletion test/ajax-fixture.html

This file was deleted.

28 changes: 0 additions & 28 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,6 @@ QUnit.test( "HTML Query/Init", function( assert ) {
assert.equal($('<div class="html-fixture">').length, 1, "HTML Passed!" );
});

// AJAX

QUnit.test( "Ajax", function( assert ) {

QUnit.stop();

$.ajax({
type: 'GET',
url: 'ajax-fixture.html',
success: function(data) {
QUnit.ok(true, "Ajax Success Passed");
QUnit.start();
}
});

QUnit.stop();

$.ajax({
type: 'GET',
url: 'missing-fixture.html',
error: function(error) {
QUnit.ok(true, "Ajax Error Passed = " + error);
QUnit.start();
}
});

});

//Attributes

QUnit.test( "addClass", function( assert ) {
Expand Down

0 comments on commit 9048421

Please sign in to comment.