Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Some small coding problems in tutorials/file/filesystem/ #163

Closed
jjinux opened this issue Aug 18, 2012 · 1 comment
Closed

Some small coding problems in tutorials/file/filesystem/ #163

jjinux opened this issue Aug 18, 2012 · 1 comment
Assignees
Milestone

Comments

@jjinux
Copy link
Contributor

jjinux commented Aug 18, 2012

Here are some problems I found while reading: http://www.html5rocks.com/en/tutorials/file/filesystem/

var bb = new BlobBuilder(); // Note: window.WebKitBlobBuilder in Chrome 12.

Uncaught ReferenceError: BlobBuilder is not defined
window.WebKitBlobBuilder is deprecated.
It suggests that you use Blob instead, but that doesn't have the same API.

// Capture current iteration's file in local scope for the getFile() callback.
(function(f) {
  fs.root.getFile(file.name, {create: true, exclusive: true}, function(fileEntry) {
    fileEntry.createWriter(function(fileWriter) {
      fileWriter.write(f); // Note: write() can take a File or Blob object.
    }, errorHandler);
  }, errorHandler);
})(file);

Should it be fs.root.getFile(f.name, ...)?

I'm trying to run the HTML file in the "PUTTING IT ALL TOGETHER" section. When
I copy-and-paste the code into my editor (Sublime Text 2), and then load it in
a browser, I see "​" at the end of the page. I assumed that this was an
encoding issue. The problem went away once I added the following to the head:

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

Note, I was serving the file using Python's, simple builtin web server which
you can start via:

python -m SimpleHTTPServer
@ghost ghost assigned ebidel Aug 18, 2012
@ebidel
Copy link
Contributor

ebidel commented Aug 18, 2012

  1. I've been waiting to update the BlobBuilder() samples to Blob(). Now that everyone pretty much supports it, let's do it! https://developer.mozilla.org/en-US/docs/DOM/Blob
  2. Correct.
  3. The meta charset for HTML5 is: <meta charset="utf-8"> The playground demos don't have that, but probably should :\

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants