This file contains hidden or 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 XMLHttpRequest = (typeof XMLHttpRequest === 'function' || typeof XMLHttpRequest === 'object') ? XMLHttpRequest : (function () { | |
var i, l; | |
for (i = 0, l = arguments.length; i < l; i++) { | |
try { | |
arguments[i](); | |
return arguments[i]; | |
} | |
catch (error) {} | |
} |
This file contains hidden or 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
/** | |
* ECMAScript5.js (ECMA-262 Edition 5) | |
* | |
* @version 1.0 | |
* @author think49 | |
*/ | |
// 15.4.3.2 Array.isArray ( arg ) | |
// | |
// 1. If Type(arg) is not Object, return false. |
This file contains hidden or 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
// matchesCssRule.js | |
// Array.forEach(contextObject, callbackfn [, thisArg]) | |
if (typeof Array.forEach !== 'function') { | |
Array.forEach = (function (forEach) { | |
return function (contextObject, callbackfn /*, thisArg*/) { | |
return forEach.call(contextObject, callbackfn, arguments[2]); | |
}; |
This file contains hidden or 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 getStringByte (str) { | |
return encodeURIComponent(str).replace(/%[\da-zA-Z]+/g, '.').length; | |
} | |
alert(getStringByte('テスト')); // 9 | |
alert(getStringByte('test')); // 4 |
This file contains hidden or 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
// expandURI.js | |
if (!Array.indexOf) { | |
Array.indexOf = (function (indexOf) { | |
return function (contextObject, elt /*, from*/) { | |
if (arguments.length < 3) { | |
indexOf.call(contextObject, elt); | |
} else { | |
indexOf.call(contextObject, elt, arguments[2]); | |
} |
This file contains hidden or 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
// jp-domain.js | |
function JPDomain () { | |
var half_string, hyphen, mark, hiragana, katakana, kanji, TLD, SLD, domain_lastString, alphanum_domain, first_char, middle_char, end_char, japanese_domain; | |
if (!(this instanceof JPDomain)) { | |
throw new Error(this + ' is not a object created by constructor'); | |
} | |
// Base Strings |
This file contains hidden or 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
// rollover.js | |
(function () { | |
function rolloverListener (event) { | |
var target, relatedTarget, reg, src; | |
target = event.target || event.toElement; | |
relatedTarget = event.relatedTarget || event.fromElement; | |
if (target.tagName === 'IMG') { |
This file contains hidden or 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
// ExtXPathEvaluator.js | |
function ExtXPathEvaluator () { | |
if (!(this instanceof ExtXPathEvaluator)) { | |
throw new Error(this + ' is not a object created by constructor'); | |
} | |
return this; | |
} |
This file contains hidden or 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"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>はじめての Google AJAX Language API</title> | |
<script src="http://www.google.com/jsapi"></script> | |
<script src="./javascript-xpath-latest-cmp.js"></script> | |
<script src="./ExtXPathEvaluator.js"></script> | |
<script> | |
google.load('language', '1'); |
This file contains hidden or 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
// ExtXPathEvaluator.js | |
function ExtXPathEvaluator () { | |
if (!(this instanceof ExtXPathEvaluator)) { | |
throw new Error(this + ' is not a object created by constructor'); | |
} | |
return this; | |
} |