How to access and download a file from a server using HTML 5

HTML5 supports the download attribute: http://webreflection.blogspot.com/2011/08/html5-how-to-create-downloads-on-fly.html Example: Clicking on this will allow the browser to handle the download (instead of opening the file using whatever application is associated with the mimetype), including a progress bar. Note: You really want to be careful not to deviate from normal user expectation by trying to create your own … Read more

How to get scrollbar position with Javascript?

You can use element.scrollTop and element.scrollLeft to get the vertical and horizontal offset, respectively, that has been scrolled. element can be document.body if you care about the whole page. You can compare it to element.offsetHeight and element.offsetWidth (again, element may be the body) if you need percentages.

Blender vs. Unity 

Blender and Unity are not the same things. Unity is a game engine, which means that its purpose is to create games, and you can program in it using C# or JavaScript. But you cannot make 3d models in it. While Blender is a program for modelling mainly. You can create applications or games in it but it … Read more

How do I make JavaScript beep?

It’s not possible to do directly in JavaScript. You’ll need to embed a short WAV file in the HTML, and then play that via code. An Example: You would then call it from JavaScript code as such: This should do exactly what you want – you’ll just need to find/create the beep sound yourself, which … Read more

Error `sec_error_revoked_certificate` when viewed in Firefox only

When Firefox web browser checks a security certificate, it also checks with the issuing authority if the certificate is valid. It appears that, near a certificate’s expiration date, the issuing authority may release a new certificate. The two certificates have conflicting expiration dates. For reasons unknown, this caused Firefox to report a sec_error_revoked_certificate error and … Read more

What is the best way to profile javascript execution?

Firebug Firebug provides a highly detailed profiling report. It will tell you how long each method invocation takes in a giant (detailed) table. You need to call console.profileEnd () to end your profile block. See the console API here: http://getfirebug.com/wiki/index.php/Console_API Blackbird Blackbird (official site) also has a simpler profiler (can be downloaded from here)