Tag Archives: Javascript

Download file using WinJS.xhr

Snippet to download a file using WinJS.xhr and save it. The file variable below is a StorageFile, result of pickSaveFileAsync. Note the usage of responseType: “blob” as an option to xhr, and how it is copied to the file stream with msDetachStream. 1 2 3 4 5 6 7 8 9 10 11 12 13 […]

Javascript function to find background task by name on Windows 8

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 FindTask: function (taskName) { var background = Windows.ApplicationModel.Background; var iter = background.BackgroundTaskRegistration.allTasks.first(); var hascur = iter.hasCurrent;   while (hascur) { var cur = iter.current.value;   if (cur.name === taskName) { return cur; }   hascur = iter.moveNext(); } […]

MD5 in YQL in hexadecimal form using Javascript

Undocumented YQL crypto method to return a hexadecimal representation of the MD5 encoding of a string: 1 y.crypto.encodeMd5Hex(’some string’);y.crypto.encodeMd5Hex(‘some string’);

Tutorial de jQuery

Tradução de Getting Started with jQuery Esse tutorial é uma introdução à biblioteca jQuery. É necessário conhecimento básico de Javascript e document object model (DOM). Partiremos bem do começo e explicaremos detalhes quando necessário. Abrangiremos um simples exemplo de olá mundo, seletores e eventos básicos, AJAX, FX, e uso e confecção de plugins. O tutorial […]