Create a file using Javascript in Chrome on client side

Sure you can, using the brand new APIs. window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; window.requestFileSystem(window.TEMPORARY, 1024*1024, function(fs) { fs.root.getFile(‘test.bin’, {create: true}, function(fileEntry) { // test.bin is filename fileEntry.createWriter(function(fileWriter) { var arr = new Uint8Array(3); // data length arr[0] = 97; // byte data; these are codes for ‘abc’ arr[1] = 98; arr[2] = 99; var blob … Read more

How can I retain the scroll position of a scrollable area when pressing back button?

During page unload, get the scroll position and store it in local storage. Then during page load, check local storage and set that scroll position. Assuming you have a div element with id element. In case it’s for the page, please change the selector 🙂 $(function() { $(window).unload(function() { var scrollPosition = $(“div#element”).scrollTop(); localStorage.setItem(“scrollPosition”, scrollPosition); … Read more

jQuery focus not working in Chrome

Seems like a bug in Chrome. Sometimes it is too fast to execute events properly;) Found a workaround http://jsfiddle.net/Rd2rZ/ $(“#one”).on(“input”, function() { if($(“#one”).val().length == 2) { setTimeout(function(){ $(“#two”).focus(); }, 1); } }); Use setTimeout with a minimal delay. It will slow down Chrome and make it work.

Where is the new Emulation tab in Chromes console drawer?

See here for more information. Before starting open the dev tools console (on a Mac cmd-option-i) Open the Settings panel within the dev tools console (click gear icon on right side) Check “Show ‘Emulation’ view in console drawer (looks like you have already done this step) and close screen Switch to the sources tab of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)