Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20240528-BJava
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
20240528-BJava
Commits
20d3b09e
Commit
20d3b09e
authored
Jun 28, 2024
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pobieranie JSONa w jQuery
parent
465cef80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
wykonaj_skrypt.jsp
...ring/src/main/webapp/WEB-INF/templates/wykonaj_skrypt.jsp
+8
-2
No files found.
PC33-SklepSpring/src/main/webapp/WEB-INF/templates/wykonaj_skrypt.jsp
View file @
20d3b09e
...
@@ -5,17 +5,23 @@
...
@@ -5,17 +5,23 @@
<title>
Title
</title>
<title>
Title
</title>
<script
src=
"jquery-3.7.1.min.js"
></script>
<script
src=
"jquery-3.7.1.min.js"
></script>
<script>
<script>
$
(
document
).
ready
(
function
(
event
)
{
function
pobierz
(
)
{
$
.
getJSON
(
"/rest/products"
,
function
(
data
)
{
$
.
getJSON
(
"/rest/products"
,
function
(
data
)
{
// console.log(data)
// console.log(data)
data
.
forEach
((
product
)
=>
{
$
(
"#produkty"
).
append
(
"<p> "
+
product
.
productName
+
" za cenę "
+
product
.
price
+
"</p>"
)})
data
.
forEach
((
product
)
=>
{
$
(
"#produkty"
).
append
(
"<p> "
+
product
.
productName
+
" za cenę "
+
product
.
price
+
"</p>"
)})
});
})
}
$
(
document
).
ready
(
function
(
event
)
{
$
(
"#guzik"
).
on
(
"click"
,
pobierz
)
})
})
</script>
</script>
</head>
</head>
<body>
<body>
<h1>
Stronka ze skryptem
</h1>
<h1>
Stronka ze skryptem
</h1>
<div><button
id=
"guzik"
>
Pobierz produkty
</button></div>
<div
id=
"produkty"
>
<div
id=
"produkty"
>
</div>
</div>
...
...
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