HTML5 API – File.slice changed

Firefox and Google Chrome implemented File API for manipulating with files. It contained very usefulĀ function slice.

Slice allowed you to read part of file content. This was quite handy when dealing with big files.

Poorly chosen name for API function caused split in browsers unity. Here is explanation:

This method was removed in Gecko 5.0 (Firefox 5.0) because its syntax differs from that of Array.slice() and String.slice(). Work is ongoing on standardizing its replacement, but for now you can use the mozSlice() method on Gecko-based browsers.


Method was replaced by:

  • mozSlice – in Firefox
  • webkitSlice – in Google Chrome

There is one important difference in the second parameter of function:

  • In case of slice it was length of block that should be loaded.
  • In case of *Slice it is the end position of block (length + start position).
No votes yet.
Please wait...

Leave a comment

6. May 2011 at 15:00 - Rich Internet Application (Tags: , , , , , ). Both comments and pings are currently closed.

Comments are closed.