Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
javab_20230928
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
javab_20230928
Commits
67b256e0
Commit
67b256e0
authored
Nov 10, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jQuery - pobieranie danych jednego produktu
parent
404360ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletions
+28
-1
index.html
PC38-RestSpring/src/main/resources/templates/index.html
+28
-1
No files found.
PC38-RestSpring/src/main/resources/templates/index.html
View file @
67b256e0
...
@@ -5,13 +5,39 @@
...
@@ -5,13 +5,39 @@
<title>
Strona główna
</title>
<title>
Strona główna
</title>
<script
th:src=
'@{/jquery-3.7.1.min.js}'
></script>
<script
th:src=
'@{/jquery-3.7.1.min.js}'
></script>
<script>
<script>
function
pobierz_dane
(
evt
)
{
// alert('Pobieram!');
let
response
=
$
.
getJSON
(
'products/1'
,
null
,
(
data
)
=>
{
console
.
log
(
'data:'
,
data
);
$
(
'#product'
).
text
(
'Nazwa produktu: '
+
data
.
productName
)
});
console
.
log
(
response
);
}
$
(
document
).
ready
(()
=>
{
$
(
document
).
ready
(()
=>
{
alert
(
'Heja!'
);
// alert('Heja!');
$
(
'#hello'
).
html
(
'To dopisało <b>jQuery</b>'
);
$
(
'#btn-pobierz'
).
on
(
'click'
,
pobierz_dane
);
});
});
</script>
</script>
<style>
#product
{
margin
:
2em
;
border
:
4px
solid
blue
;
padding
:
1em
;
}
</style>
</head>
</head>
<body>
<body>
<h1>
Witajcie w naszej apce
</h1>
<h1>
Witajcie w naszej apce
</h1>
<div
id=
"hello"
></div>
<div
id=
"hello"
></div>
<div>
<button
id=
"btn-pobierz"
>
Pobierz dane
</button>
</div>
<div
id=
"product"
>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment