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
<script type="text/javascript"> | |
xmlDoc=loadXMLDoc("/example/xdom/books.xml"); | |
x=xmlDoc.getElementsByTagName('book')[0]; | |
cloneNode=x.cloneNode(true); | |
xmlDoc.documentElement.appendChild(cloneNode); | |
//Output all titles | |
y=xmlDoc.getElementsByTagName("title"); | |
for (i=0;i<y.length;i++) | |
{ |
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
<?PHP | |
$json = json_decode(file_get_contents("data.js")); | |
$callback = $_GET["callback"]; | |
header("Content-type: application/json"); | |
echo $callback.'('.json_encode($json).')'; | |
?> |
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
// Lastly, add in the `requestAnimationFrame` shim, if necessary. Does nothing | |
// if `requestAnimationFrame` is already on the `window` object. | |
(function () { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | |
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; | |
window.cancelAnimationFrame = | |
window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; | |
} |
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
/** | |
* Created by jiangcheng.wxd on 14-5-28. | |
*/ | |
(function(window){ | |
var Query = (function (queryString) { | |
function parseURL(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
return { |
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
iTween.MoveBy(gameObject,iTween.Hash( | |
"x" , 2, | |
"time", 0.2f | |
)); | |
iTween.MoveTo(gameObject,iTween.Hash( | |
"x",6,"time",4, | |
"loopType","pingPong", | |
"delay",.4, | |
"easeType","easeInOutQuad" |
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 fireEvent = function (element,event){ | |
var evt = document.createEvent('HTMLEvents'); | |
// initEvent接受3个参数: | |
// 事件类型,是否冒泡,是否阻止浏览器的默认行为 | |
evt.initEvent(event, true, true); | |
return !element.dispatchEvent(evt); | |
}; |
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
// | |
hr{ | |
border-width: 0px; | |
border-top: 2px dashed #d8d8d8; | |
color: #d8d8d8; | |
height: 1px; | |
} |
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
// (c) copyright unscriptable.com / John Hann | |
// License MIT | |
// For more robust promises, see https://github.com/briancavalier/when.js. | |
function Promise () { | |
this._thens = []; | |
} | |
Promise.prototype = { |