Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AUTO-soa-lab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eckl, Máté
AUTO-soa-lab
Commits
1358b30c
Commit
1358b30c
authored
Mar 31, 2017
by
dnsadmin
Browse files
Options
Downloads
Patches
Plain Diff
3. Feladat
parent
99278112
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/jarmuvek.html
+70
-0
70 additions, 0 deletions
static/jarmuvek.html
with
70 additions
and
0 deletions
static/jarmuvek.html
0 → 100644
+
70
−
0
View file @
1358b30c
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<title>
AJAX demo
</title>
<script
src=
"https://code.jquery.com/jquery-1.12.4.min.js"
type=
"text/javascript"
integrity=
"sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin=
"anonymous"
></script>
</head>
<body>
<script
type=
"text/javascript"
>
if
(
location
.
protocol
==
"
file:
"
)
{
document
.
write
(
"
<div style='background: #f00; color: #fff;
"
+
"
padding: 16px; font-weight: bold; text-align: center;'>
"
+
"
You've opened this file from your local hard drive.
"
+
"
You won't be able to call your services this way.<br />
"
+
"
Open this file from <code>http://localhost:XXXXX/static/
"
+
location
.
href
.
split
(
"
/
"
).
pop
()
+
"
</code> where <code>XXXXX</code> is
"
+
"
your own port printed by Flask on the console.</div>
"
);
}
function
button_click_handler
(
evt
)
{
var
button
=
evt
.
target
;
alert
(
"
rendszam =
"
+
button
.
name
);
}
function
load_data_into_table
(
data
)
{
var
jarmuvek
=
data
.
jarmuvek
;
var
table
=
document
.
getElementById
(
"
jarmuvek
"
);
for
(
var
i
=
0
;
i
<
jarmuvek
.
length
;
i
++
)
{
var
vehicle
=
jarmuvek
[
i
];
/* insert row and cells on last position (-1)
https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement.insertRow */
var
row
=
table
.
insertRow
(
-
1
);
var
cell_jarmu_kulcs
=
row
.
insertCell
(
-
1
);
var
cell_rsz
=
row
.
insertCell
(
-
1
);
var
cell_uh
=
row
.
insertCell
(
-
1
);
var
cell_btn
=
row
.
insertCell
(
-
1
);
/* $(element) makes it possible to call jQuery
convenience methods on them like text() */
$
(
cell_jarmu_kulcs
).
text
(
vehicle
.
jarmu_kulcs
);
$
(
cell_rsz
).
text
(
vehicle
.
rendszam
);
$
(
cell_uh
).
text
(
vehicle
.
uzembehelyezes
);
var
button
=
document
.
createElement
(
"
input
"
);
button
.
setAttribute
(
"
type
"
,
"
button
"
);
button
.
setAttribute
(
"
value
"
,
"
>
"
);
button
.
setAttribute
(
"
name
"
,
vehicle
.
rendszam
);
cell_btn
.
appendChild
(
button
);
$
(
button
).
click
(
button_click_handler
);
}
}
$
(
function
()
{
$
.
ajax
({
url
:
"
../jarmuvek.json
"
,
dataType
:
"
json
"
,
success
:
load_data_into_table
});
});
</script>
<table
id=
"jarmuvek"
>
<tr>
<th>
jarmu_kulcs
</th>
<th>
rendszam
</th>
<th>
uzembehelyezes
</th>
</tr>
</table>
</body>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment