dev.progysm.com
Javascript
- Valider une carte de crédit
- ysm.js
- (null|HTMLElement) ysm.get(String id) aka getElementById
- String ysm.html(String str)
- (null|HTMLElement) ysm.q(String cssSelector) aka querySelector
- NodeList(HTMLElement) ysm.qa(String cssSelector) aka querySelectorAll
- HTMLScriptElement ysm.loadScript(String src[, Function callback])
- ysmform.js
- (null|HTMLInputElement) ysmform.getNextInput(HTMLInputElement el)
- ysmajax.js
- ysm.ajax.get(String url, Object data, Function success, Function fail)
- ysm.ajax.getjson(String url, Object data, Function success, Function fail)
- Paper/rock/scissors snippet: var c = ["paper","rock","scissors"], pick=function() { return c[Math.floor(Math.random()*c.length)]; }, c1=pick(), c2=pick(), next=(function(){return c[(c.indexOf(c1)+1)%c.length]})(); [c1, c2, c1==c2 ? 'tie' : c2==next ? 'win' : 'lose']
- Éditeur en ligne (REPL)/site de copie (paste)