Skip to content

Commit a900f7b

Browse files
committed
fix examples
1 parent e8c9494 commit a900f7b

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

examples/GUI/gui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var dbFileElm = document.getElementById('dbfile');
66
var savedbElm = document.getElementById('savedb');
77

88
// Start the worker in which sql.js will run
9-
var worker = new Worker("/dist/worker.sql-wasm.js");
9+
var worker = new Worker("../../dist/worker.sql-wasm.js");
1010
worker.onerror = error;
1111

1212
// Open a database

examples/persistent.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
<head>
44
<meta charset="utf8">
55
<title>Persistent sqlite</title>
6-
<script src="/dist/sql-wasm.js"></script>
6+
<script src="../dist/sql-wasm.js"></script>
77
</head>
88
<body>
99
<p>You have seen this page <span id="views">0</span> times.</p>
1010
<div>
1111
You have been here on the following dates: <ol id="dates"></ol>
1212
</div>
1313
<script>
14+
var baseUrl = '../dist/';
1415

1516
function toBinArray (str) {
1617
var l = str.length,

examples/repl.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!doctype html>
2+
<html>
3+
<!--Simple Read eval print loop for SQL-->
4+
<head>
5+
<meta charset="utf8">
6+
<title>SQL REPL</title>
7+
<script src="../js/sql.js"></script>
8+
</head>
9+
<body>
10+
<input type='text' id='input' placeholder="ENTER SOME SQL" size='50'
11+
value="CREATE TABLE test(val);INSERT INTO test VALUES (666); SELECT * FROM test">
12+
<button id='submit'>Execute</button>
13+
<pre id='result'></pre>
14+
<pre id='error'></pre>
15+
<script>
16+
17+
//Open a blank database
18+
var db = new SQL.Database();
19+
20+
document.getElementById('submit').onclick = function(){
21+
var sql = document.getElementById('input').value;
22+
var result = '', error='';
23+
try {result = db.exec(sql);}
24+
catch(e) {error = e;}
25+
document.getElementById('result').innerHTML = JSON.stringify(result, null, ' ');
26+
document.getElementById('error').innerHTML = error;
27+
};
28+
</script>
29+
</body>

examples/requireJS.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<script src='http://requirejs.org/docs/release/2.3.6/minified/require.js'></script>
44

55
<script>
6-
var baseUrl = '/dist'
6+
var baseUrl = '../dist'
77
require.config({
88
baseUrl: baseUrl
99
});

examples/simple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<meta charset="utf8" />
22
<html>
3-
<script src='/dist/sql-wasm-debug.js'></script>
3+
<script src='../../dist/sql-wasm-debug.js'></script>
44
<script>
55
config = {
66
locateFile: (filename, prefix) => {

0 commit comments

Comments
 (0)