Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 40 lines (33 sloc) 1.7 KB
<!DOCTYPE html>
<title>your app</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="" />
<script src=""></script>
<script src=""></script>
<script type="text/javascript">
$(document).ready(function() {
$("#header").html("Your operating system is: " + os.type());
$("#button").click(function() {
var filepath = (os.type() != 'windows') ? '/etc/hosts' : 'C:\\Windows\\System32\\drivers\\etc\\hosts';
var callback = function (err, data) {
if (err) throw err;
fs.readFile(filepath, callback);
<div data-role="page">
<div data-role="header">
<h1 id="header"></h1>
</div><!-- /header -->
<div data-role="content">
<a href="#" id="button" data-role="button" data-icon="star">Click to read /etc/hosts file</a>
</div><!-- /content -->
</div><!-- /page -->