This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$.ajax({url:'http://xxxxxxxx'}) | |
.done(function(){console.log('success!');}) | |
.fail(function(){console.log('failed...');}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
function func1() { | |
var deferred = $.Deferred(); | |
setTimeout(function(){ | |
(Math.floor(Math.random() * 2) == 1) ? deferred.resolve('success') : deferred.reject('failed'); | |
},2000); | |
return deferred.promise(); | |
}; | |
func1() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
function func1() { | |
var deferred = $.Deferred(); | |
setTimeout(function(){ | |
(Math.floor(Math.random() * 2) == 1) ? deferred.resolve() : deferred.reject(); | |
},2000); | |
return deferred.promise(); | |
}; | |
function funcS(){console.log('success!');} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
function func1() { | |
var deferred = $.Deferred(); | |
setTimeout(function(){ | |
(Math.floor(Math.random() * 2) == 1) ? deferred.resolve(true) : deferred.reject(false); | |
},2000); | |
return deferred.promise(); | |
}; | |
function funcS(){console.log('success!');} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
function func1(id) { | |
var deferred = $.Deferred(); | |
setTimeout(function(){ | |
(Math.floor(Math.random() * 2) == 1) ? deferred.resolve('true' + id) : deferred.reject('false' + id); | |
},2000); | |
return deferred.promise(); | |
}; | |
function funcS(){console.log('success!');} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
function preloadImg(src) { | |
var deferred = $.Deferred(), img = new Image(), self = this; | |
img.addEventListener('load', function(){ | |
deferred.resolve(src); | |
}); | |
img.addEventListener('error', function(){ | |
deferred.reject(src); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$.ajax({url:'http://xxxxxxxx', | |
success:function(){console.log('success!');}, | |
error:function(){console.log('failed...');} | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="ja" ng-app><!-- [b] - ng-app属性を追加 --> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- [a] - AngularJSを読込 --> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script> | |
<title>The Basics</title> | |
</head> | |
<body> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="ja" ng-app> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script> | |
<script src="todo.js"></script><!-- [a] - todo.jsを読込 --> | |
<link rel="stylesheet" href="todo.css"> | |
<title>Add Some Control</title> | |
</head> | |
<body> |
OlderNewer