1 Star 0 Fork 0

田园书生/my-test-electron

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
in2.html 3.31 KB
一键复制 编辑 原始数据 按行查看 历史
stephane varloteaux 提交于 2019-01-04 11:26 . Add files via upload
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<!-- Insert this line above script imports -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<!-- normal script imports etc -->
<script src="js/jquery-3.3.1.min.js"></script>
<script src='js/sql.js'></script>
<!-- Insert this line after script imports -->
<script>if (window.module) module = window.module;</script>
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark static-top">
<div class="container">
<a class="navbar-brand" href="#">Start Bootstrap</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">IN</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Services</a>
</li>
<li class="nav-item">
<a id="ecris" class="nav-link" href="#">ecris</a>
</li>
<li class="nav-item">
<a id="Qbtn" class="nav-link" href="#">Quitter</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h1 class="mt-5">A Bootstrap 4 Starter Template</h1>
<p class="lead">Complete with pre-defined file paths and responsive navigation!</p>
<ul class="list-unstyled">
<li>Bootstrap 4.1.3</li>
<li><div id="resul">aaa</div></li>
</ul>
</div>
</div>
</div>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script>
// You can also require other files to run in this process
require('./js/renderer.js');
const remote = require('electron').remote // chargement de l'api remote
document.getElementById('Qbtn').onclick = function(event) {
var window = remote.getCurrentWindow() // on récupère la fenetre courante
window.close() // on ferme la fenetre
}
$("#ecris").click( function()
{
var fs = require('fs');
var sql = require("./js/sql.js");
var filebuffer = fs.readFileSync("bd/mybd.sqlite");
var db = new sql.Database(filebuffer);
db.run("INSERT INTO test (col1, col2) VALUES ('gerald','coucou')");
var data = db.export();
var buffer = new Buffer(data);
fs.writeFileSync("bd/mybd.sqlite", buffer );
db.close();
});
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/tyss521/my-test-electron.git
git@gitee.com:tyss521/my-test-electron.git
tyss521
my-test-electron
my-test-electron
master

搜索帮助