title: How to access SDcard clicking on a html link through javascript..?
body: <p><strong>EDIT:</strong></p>
  
  <p>Basically i want an Html file embeded with javascript or Jquery that can access SDCARD contents directly,while opening it in a browser(since it is an html file).Since it is accessible VIA an activity i have posted code for it,But i want to hit SDCARD docs directly rather than from an android app.</p>
  
  <p><strong>Posted:</strong></p>
  
  <p>I have a HTML file stored in Sdcard which consist of a code including javascript to access SDcard contents.</p>
  
  <p>I have tested the same code from an Activity and webView and its working fine,But i want that the <code>content to be displayed on directly clicking on HTML Link</code> rather than through an activity.</p>
  
  <p>Is there any way to write <code>Android permissions in HTML CODE</code>.or how would i access it directly using HTML,JavaSCRIPT or JQUERY etc..</p>
  
  <p>The code is as follows:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Cordova&lt;/title&gt;
  &lt;script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"&gt;&lt;/script&gt;
  
  
  &lt;script type="text/javascript" charset="utf-8"&gt;
  
       var edt=document.getElementById("")
  
  
      function getFileSystem() {
          window.LocalFileSystem = window.requestFileSystem
                  || window.webkitRequestFileSystem;
  
          alert("====== hey its me===");
  
          window.requestFileSystem(1, 0, onFileSystemSuccessUpload, fail);    
         }
  
      function fail() {
          console.log("Error getting system");
      }
  
      function onFileSystemSuccessUpload(fileSystem) {
          // get directory entry through root and access all the folders
          var directoryReader = fileSystem.root.createReader();
  
          // Get a list of all the entries in the directory
          directoryReader.readEntries(successReader, fail);
  
      }
  
      function successReader(entries) {
          var i;
          for (i = 0; i &lt; entries.length; i++) {
              //alert(entries[i].name);
              document.write("&lt;p&gt;" + entries[i].name+"&lt;/p&gt;");
              //document.getElementById("text1").innerHTML = "" + entries[i].name;
              if (entries[i].isDirectory == true) {
                  var directoryReaderIn = entries[i].createReader();
                  directoryReaderIn.readEntries(successReader, fail);
  
              }
  
          }
      }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
          &lt;a onclick="getFileSystem()" href="javascript:void(0);"&gt;Click here to View File System&lt;/a&gt;
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>cordova.js is kept in parallel directory as of html file../</p>