Toggle navigation
Toggle navigation
This project
Loading...
Sign in
공태현
/
healthcare-with-webcam
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
공태현
2022-05-30 14:59:27 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2de8ffb9ed15b881205f020b933be613b987b52b
2de8ffb9
1 parent
a97cd89a
Implement move page function and get-js-file-API
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
server.js
views/mainPage/main.html
views/mainPage/main.js
server.js
View file @
2de8ffb
...
...
@@ -15,6 +15,12 @@ app.get('/', (req,res) => {
res
.
render
(
'main.html'
)
})
// js 파일 전송.
app
.
get
(
'/main.js'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
__dirname
+
'/views/mainPage/main.js'
)
})
app
.
get
(
'/squart'
,
(
req
,
res
)
=>
{
app
.
set
(
'views'
,
__dirname
+
'/views/squartPage'
)
res
.
render
(
'squart.html'
)
...
...
views/mainPage/main.html
View file @
2de8ffb
...
...
@@ -8,5 +8,10 @@
</head>
<body>
Main Page
<div>
<input
type=
"button"
value =
"squart start"
id =
"moveSquart"
onclick=
"moveSquartPage()"
/>
</div>
<script
type=
"text/javascript"
src=
"./main.js"
></script>
</body>
</html>
\ No newline at end of file
...
...
views/mainPage/main.js
0 → 100644
View file @
2de8ffb
function
moveSquartPage
()
{
location
.
href
=
"/squart"
;
}
const
movePage
=
document
.
getElementById
(
"moveSquart"
)
movePage
.
addEventListener
(
'click'
,
moveSquartPage
);
\ No newline at end of file
Please
register
or
login
to post a comment