Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
javascript-alapok
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Börcsök Barnabás
javascript-alapok
Commits
7e7daec7
Commit
7e7daec7
authored
Sep 23, 2020
by
bobarna
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parents
Branches
master
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
index.html
+170
-0
170 additions, 0 deletions
index.html
schdesign.png
+0
-0
0 additions, 0 deletions
schdesign.png
script.js
+0
-0
0 additions, 0 deletions
script.js
simonyi_color.png
+0
-0
0 additions, 0 deletions
simonyi_color.png
with
170 additions
and
0 deletions
index.html
0 → 100644
+
170
−
0
View file @
7e7daec7
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Javascript alapok
</title>
</head>
<body>
<!-- document.getElementById("demo").innerHTML = "Hello JavaScript"; -->
<!-- ' ' quoteal is működik-->
<p
id=
"demo"
></p>
<!-- HTML attribútum megváltoztatása -->
<button
onclick=
"document.getElementById('logo').src='schdesign.png'"
>
Kör
</button>
<img
id=
"logo"
src=
"schdesign.png"
style=
"width:100px"
>
<button
onclick=
"document.getElementById('logo').src='simonyi_color.png'"
>
Szakkoli
</button>
<!-- HTML stílus megváltoztatása -->
<!-- document.getElementById("demo").style.fontSize = "35px"; -->
<p
id=
"demo"
>
Szia, én egy pici paragrafus vagyok.
</p>
<!-- HTML elementek eltűntetése, megjelenítése -->
<!-- document.getElementById("demo").style.display = "none"; -->
<!-- document.getElementById("demo").style.display = "block"; -->
<script>
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"
JS 4 the win
"
;
</script>
<script>
function
myFunction
()
{
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"
Paragraph changed.
"
;
}
</script>
<button
type=
"button"
onclick=
"myFunction()"
>
Try it
</button>
<!-- külső JS fájl -->
<script
src=
"script.js"
></script>
<script>
document
.
getElementById
(
"
demo
"
).
innerHTML
=
5
+
6
;
window
.
alert
(
5
+
6
);
// a window keyword kihagyható, az az implicit global scope
alert
(
5
+
6
);
console
.
log
(
5
+
6
)
/*
műveletek
---------
+ összeadás
- kivonás
* szorzás
** hatványozás (ES2016)
/ osztás
% moduló
++ inkrement
-- decrement
*/
/*
értékadások
-----------
=
+=
-=
/=
%=
**=
*/
// Sztringek
var
txt1
=
"
Schönherz
"
;
var
txt2
=
"
Design
"
;
var
txt3
=
"
Stúdió
"
;
var
output
=
txt1
+
"
"
+
txt2
;
output
+=
"
"
+
txt3
;
output
+=
3
;
var
x
=
5
+
5
;
var
y
=
"
5
"
+
5
;
console
.
log
(
x
+
"
"
+
y
+
"
Hello
"
+
5
);
/*
Összehasonlítás
==
===
!=
!==
>
<
>=
<=
? : tertiary operator
Logikai operátorok
&& és
|| vagy
! nem
*/
age
=
17
;
bekuldottegynagykorutaboltba
=
false
;
if
(
age
<
18
||
!
bekuldottegynagykorutaboltba
)
{
console
.
log
(
"
nem ihat
"
);
}
else
{
if
(
bekuldottegynagykorutaboltba
)
console
.
log
(
"
ejnyebejnye, nem szép dolog!
"
);
console
.
log
(
"
egészségedre!
"
);
}
</script>
<!-- nem lehet külső eszközöket elérni, random funky stuff: -->
<button
onclick=
"window.print()"
></button>
<script>
var
x
,
y
,
z
;
// Statement 1
x
=
5
;
// Statement 2
y
=
6
;
// Statement 3
z
=
x
+
y
;
// Statement 4
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"
Hello Dolly.
"
;
var
kor
=
"
schdesign
"
;
console
.
log
(
kor
);
// Javascript Object == JSON
var
schdesign
=
{
nev
:
"
schdesign
"
,
reszort
:
"
Simonyi
"
,
kollegium
:
Schönherz
,
tagok_szama
:
42
,
klubszoba
:
919
,
get_name
:
function
()
{
return
this
.
nev
+
"
a kör neve.
"
;
}
}
console
.
log
(
"
A
"
+
schdesign
.
kollegium
+
"
ban működő
"
+
schdesign
+
"
kör.
"
);
console
.
log
(
schdesign
.
get_name
);
</script>
<script>
var
korok
;
korok
=
[
"
schdesign
"
,
"
SEM
"
,
"
HA5KFU
"
,
"
LEGO
"
,
"
SPOT
"
,
"
AC
"
,
"
BSS
"
,
"
Kir-Dev
"
]
console
.
log
(
"
A Simonyiban
"
+
korok
.
length
+
"
kör van.
"
);
output
=
"
<ul>
"
;
for
(
i
=
0
;
i
<
korok
.
length
;
i
++
)
{
output
+=
"
<li>
"
+
korok
[
i
]
+
"
</li>
"
;
}
text
+=
"
</ul>
"
;
document
.
write
(
output
);
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
schdesign.png
0 → 100644
+
0
−
0
View file @
7e7daec7
11.4 KiB
This diff is collapsed.
Click to expand it.
script.js
0 → 100644
+
0
−
0
View file @
7e7daec7
This diff is collapsed.
Click to expand it.
simonyi_color.png
0 → 100644
+
0
−
0
View file @
7e7daec7
13.7 KiB
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