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
Object.prototype.mix = function() { | |
var c = Object.clone(this), prop, pprop, p; | |
for (var i = 0, len = arguments.length; i < len; i++) { | |
for (prop in arguments[i]) { | |
c[prop] = arguments[i][prop]; | |
} | |
} | |
return c; | |
}; |
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
Object.prototype.mix = function(o) { | |
var child = this, | |
parent = {}, | |
ppropList = []; | |
var contains = function(ary, value) { | |
for (var i in ary) { | |
if (ary.hasOwnProperty(i) && ary[i] === value) { | |
return true; | |
} |
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
<html> | |
<head> | |
<script> | |
Object.prototype.mix = function(o) { | |
var child = this, | |
parent = {}, | |
ppropList = []; | |
var contains = function(ary, value) { |
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
Object.prototype.mix = function() { | |
var obj = arguments, | |
propList = []; | |
// Objectの独自拡張メソッドは追加しない | |
for (var pprop in Object.prototype) { | |
propList.push(pprop); | |
} | |
// Object拡張したプロパティに該当すればtrue |
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
var Module = {}; | |
Module.create = function(base) { | |
if (!!document.attachEvent) { | |
base.mix = function() { | |
var parents = arguments, | |
child = this; | |
for (var i = 0, len = parents.length; i < len; i++) { | |
var parent = parents[i]; | |
for (var prop in parent) if (!child.hasOwnProperty(prop)) { | |
if (isReserved(prop)) throw "reserved property"; |
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
var Telephone = Module.create({ | |
getPhoneName: function() { | |
return "kurodenwa"; | |
}, | |
getType: function() { | |
return "old type"; | |
}, | |
telephone: function() {} | |
}); |
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
// module define | |
var Telephone = Module.create({ | |
getPhoneName: function() { | |
return "kurodenwa"; | |
}, | |
getType: function() { | |
return "old type"; | |
} | |
}); |
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
var Http = Module.create({ | |
xhr: function(url, params, opts, successCallback, errorCallback, startFunc, endFunc) { | |
var caller = function(f) { | |
if (typeof f === "function") { | |
f.call(this); | |
} | |
}; | |
var start = function() { caller(startFunc); }, | |
end = function() { caller(endFunc); }, |
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
<?php | |
$name = $_POST["name"]; | |
$result = array( | |
"result" => $name | |
); | |
echo json_encode($result); | |
?> |
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
/** | |
* HTTP関連モジュール | |
*/ | |
var Http = Module.create({ | |
/** | |
* 非同期通信を実行する | |
* @param url 送信先URL | |
* @param params 送信パラメータ | |
* @param optArgs 通信パラメータ |
OlderNewer