From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- files/hu/_redirects.txt | 14 + files/hu/_wikihistory.json | 566 +++++++ .../hu/archive/b2g_os/biztons\303\241g/index.html" | 63 + .../index.html" | 70 + files/hu/archive/b2g_os/index.html | 85 ++ .../quickstart/az_els\303\266_appod/index.html" | 261 ++++ files/hu/archive/b2g_os/quickstart/index.html | 49 + files/hu/archive/b2g_os/releases/2.0/index.html | 112 ++ files/hu/archive/b2g_os/releases/index.html | 24 + files/hu/archive/b2g_os/simulator/index.html | 88 ++ .../b2g_os/teljes\303\255tm\303\251ny/index.html" | 146 ++ .../b2g_os/using_the_app_manager/index.html | 281 ++++ files/hu/archive/index.html | 20 + .../index.html" | 18 + files/hu/css/css_grid_layout/index.html | 249 +++ files/hu/css/font-weight/index.html | 400 +++++ files/hu/css/index.html | 92 ++ files/hu/css/text-decoration/index.html | 150 ++ files/hu/dom/htmlbrelement/index.html | 32 + files/hu/dom/index.html | 74 + files/hu/glossary/abstraction/index.html | 49 + files/hu/glossary/ajax/index.html | 31 + files/hu/glossary/api/index.html | 40 + files/hu/glossary/bongeszo/index.html | 37 + files/hu/glossary/callback_function/index.html | 31 + files/hu/glossary/css/index.html | 41 + .../hu/glossary/elso_osztalyu_funkciok/index.html | 103 ++ files/hu/glossary/index.html | 27 + files/hu/glossary/javascript/index.html | 45 + files/hu/glossary/node.js/index.html | 24 + files/hu/kozossegi_api/index.html | 56 + files/hu/learn/html/bevezetes_a_html-be/index.html | 58 + files/hu/learn/html/index.html | 58 + files/hu/learn/index.html | 130 ++ .../index.html" | 78 + .../index.html" | 92 ++ .../index.html" | 60 + .../els\305\221_l\303\251p\303\251sek/index.html" | 66 + files/hu/learn/javascript/index.html | 56 + files/hu/learn/server-side/index.html | 59 + files/hu/mdn/contribute/getting_started/index.html | 101 ++ files/hu/mdn/contribute/index.html | 21 + files/hu/mdn/contribute/localize/index.html | 45 + .../oldalak_ford\303\255t\303\241sa/index.html" | 56 + files/hu/mdn/index.html | 30 + files/hu/mozilla/bugzilla/index.html | 67 + files/hu/mozilla/gecko/index.html | 64 + files/hu/mozilla/index.html | 13 + files/hu/tools/index.html | 218 +++ .../hu/web/api/document/createtextnode/index.html | 82 + files/hu/web/api/document/index.html | 665 ++++++++ files/hu/web/api/fetch_api/index.html | 107 ++ files/hu/web/api/file/index.html | 226 +++ files/hu/web/api/geolocation/index.html | 118 ++ files/hu/web/api/index.html | 18 + files/hu/web/api/webxr_device_api/index.html | 197 +++ files/hu/web/api/window.stop/index.html | 19 + files/hu/web/api/window/alert/index.html | 72 + files/hu/web/api/window/index.html | 729 +++++++++ files/hu/web/api/worker/index.html | 147 ++ files/hu/web/api/xmlhttprequest/index.html | 235 +++ .../xmlhttprequest_hasznalata/index.html | 791 ++++++++++ .../css/tools/border-radius_bemutato/index.html | 1602 ++++++++++++++++++++ files/hu/web/css/tools/index.html | 18 + files/hu/web/guide/api/index.html | 25 + files/hu/web/guide/grafika/index.html | 48 + files/hu/web/guide/index.html | 27 + files/hu/web/html/element/article/index.html | 133 ++ files/hu/web/html/element/br/index.html | 136 ++ files/hu/web/html/element/index.html | 213 +++ files/hu/web/html/element/section/index.html | 128 ++ files/hu/web/html/index.html | 84 + files/hu/web/index.html | 53 + .../a_javascript_ujboli_bemutatasa/index.html | 948 ++++++++++++ .../javascript/guide/bevezet\303\251s/index.html" | 134 ++ files/hu/web/javascript/guide/index.html | 122 ++ files/hu/web/javascript/index.html | 110 ++ .../errors/bad_return_or_yield/index.html | 54 + .../hu/web/javascript/reference/errors/index.html | 31 + .../reference/errors/stmt_after_return/index.html | 67 + .../reference/errors/unexpected_token/index.html | 46 + .../index.html" | 70 + .../reference/global_objects/array/index.html | 538 +++++++ .../reference/global_objects/array/keys/index.html | 77 + .../reference/global_objects/array/of/index.html | 94 ++ .../reference/global_objects/array/sort/index.html | 294 ++++ .../reference/global_objects/error/index.html | 218 +++ .../f\303\274ggv\303\251ny/index.html" | 112 ++ .../javascript/reference/global_objects/index.html | 192 +++ .../reference/global_objects/nan/index.html | 96 ++ .../reference/global_objects/string/index.html | 307 ++++ files/hu/web/javascript/reference/index.html | 197 +++ .../web/javascript/reference/statements/index.html | 131 ++ .../reference/statements/try...catch/index.html | 321 ++++ files/hu/web/reference/api/index.html | 65 + files/hu/web/reference/index.html | 28 + files/hu/websockets/index.html | 194 +++ files/hu/zones/index.html | 70 + 98 files changed, 14939 insertions(+) create mode 100644 files/hu/_redirects.txt create mode 100644 files/hu/_wikihistory.json create mode 100644 "files/hu/archive/b2g_os/biztons\303\241g/index.html" create mode 100644 "files/hu/archive/b2g_os/firefox_os_telep\303\255t\303\251se/index.html" create mode 100644 files/hu/archive/b2g_os/index.html create mode 100644 "files/hu/archive/b2g_os/quickstart/az_els\303\266_appod/index.html" create mode 100644 files/hu/archive/b2g_os/quickstart/index.html create mode 100644 files/hu/archive/b2g_os/releases/2.0/index.html create mode 100644 files/hu/archive/b2g_os/releases/index.html create mode 100644 files/hu/archive/b2g_os/simulator/index.html create mode 100644 "files/hu/archive/b2g_os/teljes\303\255tm\303\251ny/index.html" create mode 100644 files/hu/archive/b2g_os/using_the_app_manager/index.html create mode 100644 files/hu/archive/index.html create mode 100644 "files/hu/bevezet\303\251s_a_dokumentumobjektum-modellbe/index.html" create mode 100644 files/hu/css/css_grid_layout/index.html create mode 100644 files/hu/css/font-weight/index.html create mode 100644 files/hu/css/index.html create mode 100644 files/hu/css/text-decoration/index.html create mode 100644 files/hu/dom/htmlbrelement/index.html create mode 100644 files/hu/dom/index.html create mode 100644 files/hu/glossary/abstraction/index.html create mode 100644 files/hu/glossary/ajax/index.html create mode 100644 files/hu/glossary/api/index.html create mode 100644 files/hu/glossary/bongeszo/index.html create mode 100644 files/hu/glossary/callback_function/index.html create mode 100644 files/hu/glossary/css/index.html create mode 100644 files/hu/glossary/elso_osztalyu_funkciok/index.html create mode 100644 files/hu/glossary/index.html create mode 100644 files/hu/glossary/javascript/index.html create mode 100644 files/hu/glossary/node.js/index.html create mode 100644 files/hu/kozossegi_api/index.html create mode 100644 files/hu/learn/html/bevezetes_a_html-be/index.html create mode 100644 files/hu/learn/html/index.html create mode 100644 files/hu/learn/index.html create mode 100644 "files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/alapvet\305\221_programok_telep\303\255t\303\251se/index.html" create mode 100644 "files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/hogy_fog_kin\303\251zni_a_weboldalunk/index.html" create mode 100644 "files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/index.html" create mode 100644 "files/hu/learn/javascript/els\305\221_l\303\251p\303\251sek/index.html" create mode 100644 files/hu/learn/javascript/index.html create mode 100644 files/hu/learn/server-side/index.html create mode 100644 files/hu/mdn/contribute/getting_started/index.html create mode 100644 files/hu/mdn/contribute/index.html create mode 100644 files/hu/mdn/contribute/localize/index.html create mode 100644 "files/hu/mdn/contribute/localize/oldalak_ford\303\255t\303\241sa/index.html" create mode 100644 files/hu/mdn/index.html create mode 100644 files/hu/mozilla/bugzilla/index.html create mode 100644 files/hu/mozilla/gecko/index.html create mode 100644 files/hu/mozilla/index.html create mode 100644 files/hu/tools/index.html create mode 100644 files/hu/web/api/document/createtextnode/index.html create mode 100644 files/hu/web/api/document/index.html create mode 100644 files/hu/web/api/fetch_api/index.html create mode 100644 files/hu/web/api/file/index.html create mode 100644 files/hu/web/api/geolocation/index.html create mode 100644 files/hu/web/api/index.html create mode 100644 files/hu/web/api/webxr_device_api/index.html create mode 100644 files/hu/web/api/window.stop/index.html create mode 100644 files/hu/web/api/window/alert/index.html create mode 100644 files/hu/web/api/window/index.html create mode 100644 files/hu/web/api/worker/index.html create mode 100644 files/hu/web/api/xmlhttprequest/index.html create mode 100644 files/hu/web/api/xmlhttprequest/xmlhttprequest_hasznalata/index.html create mode 100644 files/hu/web/css/tools/border-radius_bemutato/index.html create mode 100644 files/hu/web/css/tools/index.html create mode 100644 files/hu/web/guide/api/index.html create mode 100644 files/hu/web/guide/grafika/index.html create mode 100644 files/hu/web/guide/index.html create mode 100644 files/hu/web/html/element/article/index.html create mode 100644 files/hu/web/html/element/br/index.html create mode 100644 files/hu/web/html/element/index.html create mode 100644 files/hu/web/html/element/section/index.html create mode 100644 files/hu/web/html/index.html create mode 100644 files/hu/web/index.html create mode 100644 files/hu/web/javascript/a_javascript_ujboli_bemutatasa/index.html create mode 100644 "files/hu/web/javascript/guide/bevezet\303\251s/index.html" create mode 100644 files/hu/web/javascript/guide/index.html create mode 100644 files/hu/web/javascript/index.html create mode 100644 files/hu/web/javascript/reference/errors/bad_return_or_yield/index.html create mode 100644 files/hu/web/javascript/reference/errors/index.html create mode 100644 files/hu/web/javascript/reference/errors/stmt_after_return/index.html create mode 100644 files/hu/web/javascript/reference/errors/unexpected_token/index.html create mode 100644 "files/hu/web/javascript/reference/errors/\303\251rv\303\251nytelen_t\303\255pus/index.html" create mode 100644 files/hu/web/javascript/reference/global_objects/array/index.html create mode 100644 files/hu/web/javascript/reference/global_objects/array/keys/index.html create mode 100644 files/hu/web/javascript/reference/global_objects/array/of/index.html create mode 100644 files/hu/web/javascript/reference/global_objects/array/sort/index.html create mode 100644 files/hu/web/javascript/reference/global_objects/error/index.html create mode 100644 "files/hu/web/javascript/reference/global_objects/f\303\274ggv\303\251ny/index.html" create mode 100644 files/hu/web/javascript/reference/global_objects/index.html create mode 100644 files/hu/web/javascript/reference/global_objects/nan/index.html create mode 100644 files/hu/web/javascript/reference/global_objects/string/index.html create mode 100644 files/hu/web/javascript/reference/index.html create mode 100644 files/hu/web/javascript/reference/statements/index.html create mode 100644 files/hu/web/javascript/reference/statements/try...catch/index.html create mode 100644 files/hu/web/reference/api/index.html create mode 100644 files/hu/web/reference/index.html create mode 100644 files/hu/websockets/index.html create mode 100644 files/hu/zones/index.html (limited to 'files/hu') diff --git a/files/hu/_redirects.txt b/files/hu/_redirects.txt new file mode 100644 index 0000000000..2e75df04e5 --- /dev/null +++ b/files/hu/_redirects.txt @@ -0,0 +1,14 @@ +# FROM-URL TO-URL +/hu/docs/A_Mozilla_fejleszt%C5%91i_centrum_tartalma /hu/docs/Mozilla_fejleszt%C5%91i_centrum_-_Tartalom +/hu/docs/Developer_Guide /hu/docs/Mozilla/Developer_guide +/hu/docs/Fajlok_hasznalata_webes_alkalmazasokban /hu/docs/Web/API/File/Fajlok_hasznalata_webes_alkalmazasokban +/hu/docs/HTML /hu/docs/Web/HTML +/hu/docs/HTML/Element /hu/docs/Web/HTML/Element +/hu/docs/HTML/Element/br /hu/docs/Web/HTML/Element/br +/hu/docs/JavaScript /hu/docs/Web/JavaScript +/hu/docs/JavaScript_1.5_k%C3%A9zik%C3%B6nyv /hu/docs/Web/JavaScript/Guide +/hu/docs/Kezd%C5%91lap /hu/docs/Web +/hu/docs/Kiterjeszt%C3%A9sek /hu/docs/Mozilla/Add-ons +/hu/docs/MDN/Getting_started /hu/docs/MDN/Contribute/Getting_started +/hu/docs/Web/JavaScript/JavaScript_1.5_k%C3%A9zik%C3%B6nyv /hu/docs/Web/JavaScript/Guide +/hu/docs/en /en-US/ diff --git a/files/hu/_wikihistory.json b/files/hu/_wikihistory.json new file mode 100644 index 0000000000..a768f67f81 --- /dev/null +++ b/files/hu/_wikihistory.json @@ -0,0 +1,566 @@ +{ + "Bevezetés_a_dokumentumobjektum-modellbe": { + "modified": "2019-03-23T23:46:33.058Z", + "contributors": [ + "teoli", + "Csörföly D" + ] + }, + "CSS": { + "modified": "2019-09-11T03:36:12.939Z", + "contributors": [ + "SphinxKnight", + "tetkosimi", + "teoli", + "CsörfölyD" + ] + }, + "CSS/CSS_Grid_Layout": { + "modified": "2019-03-18T21:34:45.745Z", + "contributors": [ + "kecskeskrisztian" + ] + }, + "CSS/font-weight": { + "modified": "2020-11-12T12:54:39.738Z", + "contributors": [ + "evasimonyi" + ] + }, + "CSS/text-decoration": { + "modified": "2020-11-12T10:40:09.368Z", + "contributors": [ + "evasimonyi" + ] + }, + "DOM": { + "modified": "2019-03-24T00:03:55.193Z", + "contributors": [ + "ethertank", + "fscholz", + "Csörföly D" + ] + }, + "DOM/HTMLBRElement": { + "modified": "2019-03-23T23:31:58.209Z", + "contributors": [ + "khalid32", + "urbalazs" + ] + }, + "Glossary": { + "modified": "2020-10-07T11:10:36.306Z", + "contributors": [ + "peterbe", + "SphinxKnight", + "Szelmat", + "wbamberg", + "david_ross" + ] + }, + "Glossary/AJAX": { + "modified": "2020-07-28T09:05:23.645Z", + "contributors": [ + "mmarci72" + ] + }, + "Glossary/API": { + "modified": "2020-03-23T13:25:05.816Z", + "contributors": [ + "Zoldszemesostoros" + ] + }, + "Glossary/Abstraction": { + "modified": "2020-07-27T18:42:18.284Z", + "contributors": [ + "mmarci72" + ] + }, + "Glossary/CSS": { + "modified": "2020-07-28T08:31:28.048Z", + "contributors": [ + "mmarci72" + ] + }, + "Glossary/Callback_function": { + "modified": "2020-11-18T15:57:46.953Z", + "contributors": [ + "evasimonyi" + ] + }, + "Glossary/Elso_osztalyu_funkciok": { + "modified": "2019-03-18T20:56:29.186Z", + "contributors": [ + "Szelmat" + ] + }, + "Glossary/JavaScript": { + "modified": "2020-11-16T15:08:28.654Z", + "contributors": [ + "meskobalazs", + "Szelmat" + ] + }, + "Glossary/Node.js": { + "modified": "2019-03-18T20:56:27.754Z", + "contributors": [ + "Szelmat" + ] + }, + "Glossary/bongeszo": { + "modified": "2020-07-28T08:32:30.144Z", + "contributors": [ + "mmarci72" + ] + }, + "Learn": { + "modified": "2020-11-16T14:42:59.018Z", + "contributors": [ + "meskobalazs", + "Zoldszemesostoros", + "SphinxKnight", + "qcz", + "lacsaba", + "entriek" + ] + }, + "Learn/HTML": { + "modified": "2020-07-16T22:22:18.146Z", + "contributors": [ + "chrisdavidmills" + ] + }, + "Learn/HTML/Bevezetes_a_HTML-be": { + "modified": "2020-07-16T22:22:48.153Z", + "contributors": [ + "tetkosimi" + ] + }, + "Learn/Ismerkedés_a_Világhálóval": { + "modified": "2020-07-29T16:23:02.755Z", + "contributors": [ + "szcsl" + ] + }, + "Learn/Ismerkedés_a_Világhálóval/Alapvető_programok_telepítése": { + "modified": "2020-07-31T12:06:30.955Z", + "contributors": [ + "szcsl" + ] + }, + "Learn/Ismerkedés_a_Világhálóval/Hogy_fog_kinézni_a_weboldalunk": { + "modified": "2020-08-02T13:33:58.088Z", + "contributors": [ + "szcsl" + ] + }, + "Learn/JavaScript": { + "modified": "2020-07-16T22:29:39.465Z", + "contributors": [ + "entriek" + ] + }, + "Learn/JavaScript/Első_lépések": { + "modified": "2020-07-16T22:29:51.271Z", + "contributors": [ + "Aioiui" + ] + }, + "Learn/Server-side": { + "modified": "2020-07-16T22:35:58.128Z", + "contributors": [ + "chrisdavidmills" + ] + }, + "MDN": { + "modified": "2020-02-19T19:33:49.798Z", + "contributors": [ + "jswisher", + "SphinxKnight", + "wbamberg", + "meskobalazs", + "ziyunfei" + ] + }, + "MDN/Contribute": { + "modified": "2019-01-16T19:05:51.848Z", + "contributors": [ + "wbamberg", + "meskobalazs", + "Mars" + ] + }, + "MDN/Contribute/Getting_started": { + "modified": "2020-09-30T17:11:57.281Z", + "contributors": [ + "chrisdavidmills", + "meskobalazs", + "nagyll92", + "wbamberg", + "hu-nemtom", + "bencelaszlo", + "misibacsi", + "zamcsaba" + ] + }, + "MDN/Contribute/Localize": { + "modified": "2019-01-16T22:09:06.657Z", + "contributors": [ + "wbamberg", + "meskobalazs", + "jswisher" + ] + }, + "MDN/Contribute/Localize/Oldalak_fordítása": { + "modified": "2019-12-17T21:18:30.022Z", + "contributors": [ + "wbamberg", + "meskobalazs" + ] + }, + "Mozilla": { + "modified": "2019-03-23T23:33:12.472Z", + "contributors": [ + "evilpie" + ] + }, + "Tools": { + "modified": "2020-07-16T22:44:15.072Z", + "contributors": [ + "SphinxKnight", + "kamryn12" + ] + }, + "Web": { + "modified": "2019-03-23T23:25:29.899Z", + "contributors": [ + "saboarpad", + "Rwin", + "barineveronika", + "csehferi70@gmail.com", + "teoli" + ] + }, + "Web/API": { + "modified": "2020-03-29T19:59:47.494Z", + "contributors": [ + "duduindo", + "teoli", + "Sheppy" + ] + }, + "Web/API/Document": { + "modified": "2020-10-15T22:28:55.605Z", + "contributors": [ + "sideshowbarker" + ] + }, + "Web/API/Document/createTextNode": { + "modified": "2020-10-15T22:28:37.188Z", + "contributors": [ + "sarkiroka" + ] + }, + "Web/API/Fetch_API": { + "modified": "2020-11-30T07:30:25.951Z", + "contributors": [ + "evasimonyi" + ] + }, + "Web/API/File": { + "modified": "2019-03-23T22:02:41.390Z", + "contributors": [ + "chrisdavidmills" + ] + }, + "Web/API/Geolocation": { + "modified": "2019-03-23T22:46:03.917Z", + "contributors": [ + "fscholz" + ] + }, + "Web/API/WebXR_Device_API": { + "modified": "2020-10-15T22:31:19.815Z", + "contributors": [ + "Peilei0313" + ] + }, + "Web/API/Window": { + "modified": "2020-10-15T22:20:56.772Z", + "contributors": [ + "chrisdavidmills" + ] + }, + "Web/API/Window.stop": { + "modified": "2019-03-23T23:25:32.999Z", + "contributors": [ + "jsx", + "mark_b" + ] + }, + "Web/API/Window/alert": { + "modified": "2020-10-15T22:20:45.271Z", + "contributors": [ + "sarkiroka" + ] + }, + "Web/API/Worker": { + "modified": "2019-03-23T22:21:12.416Z", + "contributors": [ + "Csucsu734" + ] + }, + "Web/API/XMLHttpRequest": { + "modified": "2020-10-15T21:58:25.775Z", + "contributors": [ + "dominicus-75", + "fscholz" + ] + }, + "Web/API/XMLHttpRequest/XMLHttpRequest_hasznalata": { + "modified": "2020-10-15T22:19:50.902Z", + "contributors": [ + "dominicus-75" + ] + }, + "Web/CSS/Tools": { + "modified": "2019-03-23T22:57:26.063Z", + "contributors": [ + "velvel53" + ] + }, + "Web/CSS/Tools/Border-radius_bemutato": { + "modified": "2019-03-23T22:57:32.009Z", + "contributors": [ + "nemesreviz" + ] + }, + "Web/Guide": { + "modified": "2019-03-23T23:16:53.049Z", + "contributors": [ + "Onsteroids" + ] + }, + "Web/Guide/API": { + "modified": "2019-09-11T09:42:54.699Z", + "contributors": [ + "SphinxKnight", + "Sheppy" + ] + }, + "Web/Guide/Grafika": { + "modified": "2019-05-08T07:13:14.821Z", + "contributors": [ + "tetkosimi" + ] + }, + "Web/HTML": { + "modified": "2019-05-09T07:19:07.882Z", + "contributors": [ + "tetkosimi", + "JLorand", + "teoli", + "dbs" + ] + }, + "Web/HTML/Element": { + "modified": "2019-03-23T23:31:53.992Z", + "contributors": [ + "teoli" + ] + }, + "Web/HTML/Element/article": { + "modified": "2020-10-15T21:59:45.091Z", + "contributors": [ + "parphis" + ] + }, + "Web/HTML/Element/br": { + "modified": "2020-03-29T20:04:13.246Z", + "contributors": [ + "duduindo", + "teoli", + "urbalazs" + ] + }, + "Web/HTML/Element/section": { + "modified": "2020-10-15T21:59:45.803Z", + "contributors": [ + "parphis" + ] + }, + "Web/JavaScript": { + "modified": "2019-03-18T20:56:29.622Z", + "contributors": [ + "Szelmat", + "pannisimai", + "tacsipacsi", + "entonibaba0720", + "bencelaszlo", + "szabopeterakos", + "Ferik355", + "teoli", + "fscholz", + "CsörfölyD" + ] + }, + "Web/JavaScript/Guide": { + "modified": "2020-03-12T19:37:34.357Z", + "contributors": [ + "teoli", + "Csörföly D", + "CsörfölyD" + ] + }, + "Web/JavaScript/Guide/Bevezetés": { + "modified": "2020-03-12T19:43:36.391Z", + "contributors": [ + "RMarcell" + ] + }, + "Web/JavaScript/Reference": { + "modified": "2020-11-19T10:10:24.248Z", + "contributors": [ + "Sealdolphin", + "tomuwhu", + "bencelaszlo", + "Minat" + ] + }, + "Web/JavaScript/Reference/Errors": { + "modified": "2020-03-12T19:47:09.844Z", + "contributors": [ + "Sheppy" + ] + }, + "Web/JavaScript/Reference/Errors/Bad_return_or_yield": { + "modified": "2020-03-23T13:33:05.843Z", + "contributors": [ + "Zoldszemesostoros", + "sanyoca" + ] + }, + "Web/JavaScript/Reference/Errors/Stmt_after_return": { + "modified": "2020-03-23T13:42:19.587Z", + "contributors": [ + "Zoldszemesostoros", + "sanyoca" + ] + }, + "Web/JavaScript/Reference/Errors/Unexpected_token": { + "modified": "2020-03-12T19:47:09.248Z", + "contributors": [ + "dorionka" + ] + }, + "Web/JavaScript/Reference/Errors/Érvénytelen_típus": { + "modified": "2020-04-19T20:35:18.887Z", + "contributors": [ + "tacsipacsi", + "sanyoca" + ] + }, + "Web/JavaScript/Reference/Global_Objects": { + "modified": "2020-03-12T19:45:17.938Z", + "contributors": [ + "Abro" + ] + }, + "Web/JavaScript/Reference/Global_Objects/Array": { + "modified": "2019-12-26T16:08:19.491Z", + "contributors": [ + "ferenczcsibiattila", + "kdex" + ] + }, + "Web/JavaScript/Reference/Global_Objects/Array/keys": { + "modified": "2020-10-15T22:04:22.331Z", + "contributors": [ + "parphis" + ] + }, + "Web/JavaScript/Reference/Global_Objects/Array/of": { + "modified": "2020-10-15T22:21:12.095Z", + "contributors": [ + "szilijanos" + ] + }, + "Web/JavaScript/Reference/Global_Objects/Array/sort": { + "modified": "2019-09-04T07:17:17.546Z", + "contributors": [ + "krisz094", + "KissBalazs", + "chvik", + "sonny89", + "brncsk", + "LeFizzy" + ] + }, + "Web/JavaScript/Reference/Global_Objects/Error": { + "modified": "2020-11-22T11:34:23.222Z", + "contributors": [ + "Sealdolphin" + ] + }, + "Web/JavaScript/Reference/Global_Objects/Függvény": { + "modified": "2020-11-16T15:30:24.183Z", + "contributors": [ + "meskobalazs", + "iamdue", + "copas2", + "dorionka" + ] + }, + "Web/JavaScript/Reference/Global_Objects/NaN": { + "modified": "2020-11-19T09:58:46.355Z", + "contributors": [ + "Sealdolphin" + ] + }, + "Web/JavaScript/Reference/Global_Objects/String": { + "modified": "2020-10-15T22:17:15.870Z", + "contributors": [ + "Zoldszemesostoros", + "SphinxKnight", + "pfeihun", + "N3U2O" + ] + }, + "Web/JavaScript/Reference/Statements": { + "modified": "2020-03-12T19:41:42.255Z", + "contributors": [ + "fscholz" + ] + }, + "Web/JavaScript/Reference/Statements/try...catch": { + "modified": "2020-10-15T22:00:49.343Z", + "contributors": [ + "Zoldszemesostoros", + "suckee86" + ] + }, + "Web/JavaScript/a_javascript_ujboli_bemutatasa": { + "modified": "2020-03-12T19:48:54.218Z", + "contributors": [ + "kisjoke91" + ] + }, + "Web/Reference": { + "modified": "2019-03-23T22:43:43.697Z", + "contributors": [ + "MR-AMIR" + ] + }, + "Web/Reference/API": { + "modified": "2019-03-23T22:43:40.626Z", + "contributors": [ + "barcai" + ] + }, + "WebSockets": { + "modified": "2019-03-23T22:56:13.956Z", + "contributors": [ + "EvanDotPro" + ] + } +} \ No newline at end of file diff --git "a/files/hu/archive/b2g_os/biztons\303\241g/index.html" "b/files/hu/archive/b2g_os/biztons\303\241g/index.html" new file mode 100644 index 0000000000..e7ace850ae --- /dev/null +++ "b/files/hu/archive/b2g_os/biztons\303\241g/index.html" @@ -0,0 +1,63 @@ +--- +title: Firefox OS security +slug: Archive/B2G_OS/Biztonság +translation_of: Archive/B2G_OS/Security +--- +

The following articles cover security-related topics about Firefox OS. This includes overall security features as well as application security and how the install process is kept secure.

+ + + + + + + +
+

Firefox OS security documentation

+
+
+ The Firefox OS security model
+
+ An overview of the Firefox OS security model.
+
+ System security
+
+ Details of security controls built-in to the FirefoxOS runtime.
+
+ Application security in Firefox OS
+
+ An overview of how applications are made secure on Firefox OS.
+
+ Securely installing and updating applications
+
+ How Firefox OS securely installs and updates applications.
+
+ Software permissions in Firefox OS
+
+ A guide to what types of software have permission to perform various tasks on Firefox OS.
+
+  Debugging and security testing with Firefox OS
+
+ This guide shows you the basic security testing steps, from opening a remote JavaScript debugger to setting up an intercepting HTTP(S) proxy against a desktop version of Firefox OS
+
+

View All...

+
+

Getting help from the community

+

If you're working with Firefox OS, or developing applications you'd like to run on Firefox OS devices, there are community resources to help you!

+
    +
  • Consult the Boot to Gecko project forum: {{ DiscussionList("dev-b2g", "mozilla.dev.b2g") }}
  • +
+
    +
  • Ask your question on Mozilla's Boot to Gecko IRC channel: #b2g
  • +
+

Don't forget about the netiquette...

+
+ + +
+

 

+
+
+ Firefox OS
diff --git "a/files/hu/archive/b2g_os/firefox_os_telep\303\255t\303\251se/index.html" "b/files/hu/archive/b2g_os/firefox_os_telep\303\255t\303\251se/index.html" new file mode 100644 index 0000000000..49ffd2f528 --- /dev/null +++ "b/files/hu/archive/b2g_os/firefox_os_telep\303\255t\303\251se/index.html" @@ -0,0 +1,70 @@ +--- +title: A Firefox OS telepítése és +slug: Archive/B2G_OS/Firefox_OS_telepítése +translation_of: Archive/B2G_OS/Building_and_installing_B2G_OS +--- +
+

Mivel a Firefox OS aktív fejlesztés alatt áll, az új verzió megjelenése előtt a legjobb módja a telepítésének egy olyan verzió, ami a jövőben frissíti magát az újabb változatra. Ez a cikk lépésről-lépésre leírja a Firefox OS (emulátorba, illetve kompatibilis eszközre) vagy a Gaia felhasználói felület (Firefox böngészőben) telepítését.

+
+ + + + + + + +
+

A Firefox OS letöltése és konfigurálása

+
+
+ Firefox OS konfigurációs áttekintés
+
+ A Firefox OS telepítése és konfigurálása sok időt igényel, az internet sebességének és a számítási teljesítménynek függvényében. Ez az oldal körvonalazza a konfiguráció lépéseit és céljait, hogy segítse a felhasználókat a folyamat során.
+
+ Firefox OS konfigurálási előfeltételek
+
+ Lépések mielőtt először konfigurálná a Firefox OS-t.
+
+ Felkészülés az első Firefox OS konfigurálására
+
+ Mielőtt konfigurálja a Firefox OS-t, klónoznia kell a tárolót, és konfigurálni az ön telepítését. Ez a cikk elmagyarázza, hogyan kell csinálni.
+
+ Firefox OS konfigurálása
+
+ Hogyan konfiguráljuk a Firefox OS-t.
+
+ Firefox OS áthelyezése
+
+ Információk arról, hogyan helyezzük át a Firefox OS-t új eszközre.
+
+

View All...

+
+

A Firefox OS  és/vagy Gaia telepítése

+
+
+ A Firefox OS vagy Gaia futtatási módjának kiválasztása
+
+ Használhatja a Gaia-t Firefox-ban, vagy a Firefox OS-t egy mobileszközön illetve PC-alapú szimulátorban. Ez az útmutató segít eldönteni, hogy melyik felel meg a legjobban az Ön igényeinek.
+
+ A Gaia használata Firefox-ban
+
+ Gaia használatának módja egy asztali Firefox böngészőben.
+
+ A Firefox OS asztali kliens használata
+
+ Útmutató Firefox OS asztali kliens futtatásához és használatához; ez szimulálja a Gaia környezetet egy asztali alkalmazáson keresztül. Ez pontosabb, mint a Gaia futtatása a Firefoxban, de nem olyan pontos, mint az emulátor.
+
+ Firefox OS emulátorok használata
+
+ Egy útmutatás a Firefox OS emulátorok konfigurálásához és használatához, és hogy mikor melyik emulátort kell használni.
+
+ Firefox OS telepítése mobileszközre
+
+ Hogyan telepítsük a Firefox OS-t  egy valódi mobileszközre.
+
+ Firefox OS és Android használata egyszerre (egy SamsungGalaxyS2-n)
+
+ Hogyan használjuk a Firefox OS-t és az Androidot egyszerre (egy Samsung Galaxy S2-n)
+
+
+

 

diff --git a/files/hu/archive/b2g_os/index.html b/files/hu/archive/b2g_os/index.html new file mode 100644 index 0000000000..ff622156a2 --- /dev/null +++ b/files/hu/archive/b2g_os/index.html @@ -0,0 +1,85 @@ +--- +title: B2G OS +slug: Archive/B2G_OS +translation_of: Archive/B2G_OS +--- +

Firefox OS (rövidítve FxOS) egy új mobil operációs rendszer amit a Mozilla fejleszt. A Linux kernelen alapuló rendszer egy Gecko alapú futtató környezetet töltbe be, ami lehetővé teszi olyan alkalmazások futtatását amik teljes egészében HTML, JavaScript, és egyéb webes alkalmazás API-k segítségével íródtak.

+ +

A Firefox OS jelenleg számos fejlesztés alatt áll; Folyamatosan azon dolgozunk hogy ön számára könnyebbé váljon a Gaia (alapértelmezett app csomag) használata, és elkészíthesse saját applikációit. Ehhez azonban sok ismeretre van szüksége a Firefox OS működéséről. Alább találhat hasznos leírásokat a Firefox OS-ra való fejlesztésről, tesztelésről, testreszabásról.

+ + + + + + + + +
+

A Firefox OS platform

+ +
+
Bevezetés a Firefox OS-be
+
Bevezető információk a Firefox OS mivoltáról és működéséről.
+
Hasznos tippek
+
Rövid tippek melyek megkönnyítik a Firefox OS használatát és fejlesztését.
+
Firefox OS platform kézikönyv
+
Teljes dokumentáció a Firefox OS platformról, magába foglalva a Gonk, Gaia, és egyébcsomagok használatát.
+
Build and install Firefox OS
+
This includes documentation for building and installing the platform onto devices, as well as building the simulator and emulators.
+
Hacking Firefox OS
+
Once you're used to the basic Firefox OS process, it's time to start hacking the OS, customizing your builds, getting things the way you think they should be! This section shows you how to get ahead.
+
Troubleshooting
+
A guide to resolving common problems with Firefox OS.
+
Firefox OS developer phone guide
+
A guide to the Firefox OS developer phones Mozilla provides to some developers. This guide also applies if someone installed Firefox OS on your phone for you.
+
+ +

Firefox OS Alkalmazás Tervezés és fejlesztés

+ +

For up-to-date information on Firefox OS App design and development, you should consult our Open Web Apps documentation center. Some other resources are listed below, but probably won't be for long, as they will be integrated into the main apps docs.

+ +
+
Tips and techniques
+
An assortment of tips and tricks (as well as workarounds for problems) that our developers have suggested for you!
+
Developer Hub
+
A collection of tools, tutorials, and services for Firefox OS app developers.
+
+ +
+
Debugging on Firefox OS
+
A guide to debugging both your mobile apps and Firefox OS itself.
+
Performance
+
Articles about optimizing Firefox OS applications.
+
+ +

View All...

+
+

Segítség kérése a közösségtől

+ +

If you're working with Firefox OS, or developing applications you'd like to run on Firefox OS devices, there are community resources to help you!

+ +
    +
  • Ask your question on Mozilla's Boot to Gecko IRC channel: #b2g
  • +
+ +

Don't forget about the netiquette...

+ + + + + + +

Források

+ + +
diff --git "a/files/hu/archive/b2g_os/quickstart/az_els\303\266_appod/index.html" "b/files/hu/archive/b2g_os/quickstart/az_els\303\266_appod/index.html" new file mode 100644 index 0000000000..92b5c36e72 --- /dev/null +++ "b/files/hu/archive/b2g_os/quickstart/az_els\303\266_appod/index.html" @@ -0,0 +1,261 @@ +--- +title: Az első appod +slug: Archive/B2G_OS/Quickstart/Az_elsö_appod +translation_of: Archive/B2G_OS/Quickstart/Your_first_app +--- +
+
+

A nyílt webes alkalmazások pontosan azt nyújtják a fejlesztőknek, amire évek óta vágynak: különböző kezelőfelületek egységes környezetét, amit kizárólag HTML, CSS és JavaScript alkalmazásoknak szántak — mindezt az első, nyílt webes felülettel, a Firefox OS-szel. Ez az útmutató egy gyors, alapszintű programozási és alkalmazásépítői instrukciót tartalmaz, hogy létrehozhasd a következő nagyszerű appot.

+
+ +

Ha szeretnél minket és ezt az útmutatót követni, letöltheted a gyors applikációkezdő mintánkat. Tudj meg többet ennek tartalmáról, és olvasd el az Alkalmazásminták útmutatót (a programozói felületek és programnyelvek angol nyelvtudást igényelnek)

+ +

Az alkalmazás felépítése

+ +

Csomagolt vs. Hostolt alkalmazások

+ +

A nyílt webes alkalmazásoknak két formájuk van: csomagolt and hostolt. A csomagolt appok alapvetően zip file-ok, melyek minden alkalmazáskiegészítőt tartalmaznak: HTML, CSS, JavaScript, képek, tanúsítványok, stb. A hostolt alkalmazások szerverről futnak, egy megadott domainen, akárcsak egy weboldal. Mindkét alkalmazástípus érvényes tanúsítványt igényel. Mikor eljön a pillanat, hogy feltöltsd az alkalmazásodat a Firefox Piactérre, akkor vagy ezt a zip file-t töltöd fel, vagy a hostolt applikációhoz mutató linket fogod megadni

+ +
+

{{EmbedYouTube("Q7x-B13y33Q")}}

+ +
+

Készült a Treehouse társulás jóvoltából: Lesd meg őket!

+
+
+ +

Ezen útmutatón keresztül el fogod készíteni a hostolt alkalmazásodat, amely a te localhost címeden lesz elérhető. Amint az appod készen áll arra, hogy megoszthasd a Firefox Piactéren, eldöntheted, hogy csomagolva, vagy hostolva osztod meg.

+ +

App Tanúsítványok

+ +

Minden Firefox appnak szüksége van egy manifest.webapp file-ra az alkalmazáson belül. A manifest.webapp file biztosítja a létszükségletű információkat az appról, úgy, mint verzó, név, leírás, ikon, hely, helyszíni láncolatok, domain, ahonnan az app telepíthető, és még sokminden. Csak a név és verziószám kötelező. A legegyszerűbb tanúsítvány (az alkalmazásmintán belül) a következőképpen néz ki:

+ +
{
+  "version": "0.1",
+  "name": "Open Web App",
+  "description": "Your new awesome Open Web App",
+  "launch_path": "/app-template/index.html",
+  "icons": {
+    "16": "/app-template/app-icons/icon-16.png",
+    "48": "/app-template/app-icons/icon-48.png",
+    "128": "/app-template/app-icons/icon-128.png"
+  },
+  "developer": {
+    "name": "Your Name",
+    "url": "http://yourawesomeapp.com"
+  },
+  "locales": {
+    "es": {
+      "description": "Su nueva aplicación impresionante Open Web",
+      "developer": {
+        "url": "http://yourawesomeapp.com"
+      }
+    },
+    "it": {
+      "description": "La tua nuova fantastica Open Web App",
+      "developer": {
+        "url": "http://yourawesomeapp.com"
+      }
+    }
+  },
+  "default_locale": "en"
+}
+ +
+

{{EmbedYouTube("dgAUgHQOm8M")}}

+ +
+

Készült a Treehouse társulás jóvoltából: lESD MEG ŐKET!

+
+
+ +

 

+ +

A kezdéshez egy alap tanúsítványra van szükséged. További részletekért olvasd el az  Alkalmazástanúsítványt.

+ +

App Tervezés & Design

+ +

Az appok kinézete kiemelkedően fontossá vált, ahogy a képernyők felbontása egyre jobb színvonalat ért el. Noha az appok fő célterülete a telefonplatformokban van, mint például a Firefox OS, egyéb eszközöknek is lehet hozzáférésük. A CSS médium lista lehetővé teszi, hogy különböző eszközök megjelenítéséhez igazodj, ahogy azt alábbi CSS példaváz mutatja:

+ +
/* The following are examples of different CSS media queries */
+
+/* Basic desktop/screen width sniff */
+@media only screen and (min-width : 1224px) {
+  /* styles */
+}
+
+/* Traditional iPhone width */
+@media
+  only screen and (-webkit-min-device-pixel-ratio : 1.5),
+  only screen and (min-device-pixel-ratio : 1.5) {
+  /* styles */
+}
+
+/* Device settings at different orientations */
+@media screen and (orientation:portrait) {
+  /* styles */
+}
+@media screen and (orientation:landscape) {
+  /* styles */
+}
+ +

Számos JavaScript és CSS keretrendszer elérhető, hogy segítsen a tervezésben és mobil app fejlesztésben (Bootstrap, stb.) Válaszd azt, amelyik a legjobban illik a stílusodhoz.

+ +

Web API-k

+ +

A JavaScript API-k (alkalmazásprogramozási felületek) legalább olyan gyorsan fejlődnek, mint maguk a készülékek. A Mozilla WebAPI kezdeményezés temérdek szabvány mobilvázlatot integrál a JavaScript API-kba. A támogatott eszközök listája elérhető a WebAPI oldalon. A legjobb gyakorlást a JavaScript eszközérzékelő biztosítja, ahogy azt itt mutatjuk:

+ +
// If this device supports the vibrate API...
+if('vibrate' in navigator) {
+    // ... vibrate for a second
+    navigator.vibrate(1000);
+}
+ +

A következő példában a <div> megjelenítését módosítottuk a készülék töltöttségének függvényében:

+ +
// Create the battery indicator listeners
+(function() {
+  var battery = navigator.battery || navigator.mozBattery || navigator.webkitBattery,
+      indicator, indicatorPercentage;
+
+  if(battery) {
+    indicator = document.getElementById('indicator'),
+    indicatorPercentage = document.getElementById('indicator-percentage');
+
+    // Set listeners for changes
+    battery.addEventListener('chargingchange', updateBattery);
+    battery.addEventListener('levelchange', updateBattery);
+
+    // Update immediately
+    updateBattery();
+  }
+
+  function updateBattery() {
+    // Update percentage width and text
+    var level = (battery.level * 100) + '%';
+    indicatorPercentage.style.width = level;
+    indicatorPercentage.innerHTML = 'Battery: ' + level;
+    // Update charging status
+    indicator.className = battery.charging ? 'charging' : '';
+  }
+})();
+ +

A fenti kódmintában, amint megerősíted a Battery API támogatottságot, további eseményfigyelőket adhatsz a chargingchange és a levelchange kódhoz, hogy frissíthesd az elemek megjelenítése. Próbáld meg hozzáadni a mintádhoz, és nézd meg magad a működését.

+ +

Rendszeresen ellenőrizd a WebAPI oldalt, hogy naprakész legyél az API készülékstátuszokkal.

+ +

API funkcionálisság telepítése

+ +

Az app kezdőmintánkban elhelyeztünk egy telepítőkapcsolót, amivel megtekintheted az appodat, mint egy mintaweboldalt, mintha az egy telepített alkalmazás lenne a Firefox OS-en. A gomb megjelenésében nincs semmi különös:

+ +
<button id="install-btn">Install app</button>
+ +

A kapcsoló az API telepítő használatával is működtethető (lásd install.js):

+ +
var manifest_url = location.href + 'manifest.webapp';
+
+function install(ev) {
+  ev.preventDefault();
+  // define the manifest URL
+  // install the app
+  var installLocFind = navigator.mozApps.install(manifest_url);
+  installLocFind.onsuccess = function(data) {
+    // App is installed, do something
+  };
+  installLocFind.onerror = function() {
+    // App wasn't installed, info is in
+    // installapp.error.name
+    alert(installLocFind.error.name);
+  };
+};
+
+// get a reference to the button and call install() on click if the app isn't already installed. If it is, hide the button.
+var button = document.getElementById('install-btn');
+
+var installCheck = navigator.mozApps.checkInstalled(manifest_url);
+
+installCheck.onsuccess = function() {
+  if(installCheck.result) {
+    button.style.display = "none";
+  } else {
+    button.addEventListener('click', install, false);
+  };
+};
+
+ +

Összegezzük, mi is történik:

+ +
    +
  1. Kapunk egy hivatkozást a telepítőkapcsolóra, amit a  button változó alatt tárolunk.
  2. +
  3. Eztuán a navigator.mozApps.checkInstalled kódot használjuk, hogy ellenőrizzük a tanúsítványban foglalt app (helyileg: http://people.mozilla.com/~cmills/location-finder/manifest.webapp) telepítve van-e az eszközön. Ezt a teszt az installCheck változóban tárolódik.
  4. +
  5. Miután a teszt sikeresen lefut, létrehoz egy sikeres eseményt, ezáltal az installCheck.onsuccess = function() { ... } fut tovább.
  6. +
  7. Eztuán tesztet futtatunk az installCheck.result létezésére egy egyszerű if állítás használatával. Ha létezik, ezzel alátámasztva, hogy az app telepítve van, elrejtjük a kapcsolót, mivel ezután erre már nincs szükség.
  8. +
  9. Ha az app nincs telepítve, egy kattintásfigyelőt adunk a kapcsolóhoz, így az install() funkció fut, amikor arra kattintunk.
  10. +
  11. Mikor a gombra kattintunk, és az install() funkció fut, eltároljuk a tanúsítvány fájlt egy manifest_url változóban tároljuk, ezután telepítjük az appot a navigator.mozApps.install(manifest_url) használatával, eltárolva ezzel egy hivatkozást az installLocFind változóban. Észrevehetjük, hogy ez a telepítés sikeres és sikertelen eseményeket is létrehoz, így annak függvényében tudsz parancsokat futtatni, hogy a telepítés sikerült-e, vagy sem.
  12. +
+ +

Feltehetőleg igazolni szeretnéd a API teljesítési állapot-ot, mikor először jutsz a telepíthető webalkalmazásokhoz.

+ +
+

Megjegyzés: a telepíthető webalkalmazásokra az "egy app/egy eredet" szabály vonatkozik. Magyarul egy hostolt alkalmazás csak egy helyről származtatható. Ez a tesztelést kissé bonyolítja, de ez megkerülhető, például különbözü sub-domaineken keresztül, Firefox OS szimulátorral, vagy a telepítő működésének Firefox Aurora/Nightly-n keresztüli tesztelésével, amiken keresztül a webalkalmazásokat az asztalodra telepítheted. Olvasd el az app tanúsítványok GYIK-et további információért.

+
+ +

WebRT API-k (Engedély-alapú API-k)

+ +

Sok  WebAPI létezik, amelyek ugyan elérhetők, de külön engedély kell egy-egy speciális tartalom eléréséhez. Az appok az engedélykérelmet a manifest.webapp file-ba regisztrálják, a következőképpen:

+ +
// New key in the manifest: "permissions"
+// Request access to any number of APIs
+// Here we request permissions to the systemXHR API
+"permissions": {
+    "systemXHR": {}
+}
+ +

Az engedély három szintje a következők:

+ + + +

Az engedélyekről bővebben a Csomagolt apptípusok alatt olvashatsz. Itt többet megtudhatsz az engedélyköteles API-król, és hogy milyen engedélyre van szükséged, nézd meg az App engedélyek tájékoztatót.

+ +
+

Fontos megjegyezni, hogy nem minden web API-t valósítottunk meg a Firefox OS szimulátoron belül.

+
+ +

Eszközök és tesztelés

+ +

A tesztelés rendkívül fontos, amikor az eszköztámogatásról van szó. Számos opció áll rendelkezésre a telepíthető webalkalmazások tesztelésére.

+ +

Firefox OS Szimulátor

+ +

Installing and using the Firefox OS Simulator is the easiest way to get up and running with your app. After you install the simulator, it is accessible from the Tools -> Web Developer -> Firefox OS Simulator menu. The simulator launches with a JavaScript console so you can debug your application from within the simulator.

+ +

App Manager

+ +

The new kid on the block with regards to testing tools is called the App Manager. This tool allows you to connect desktop Firefox to a compatible device via USB (or a Firefox OS simulator), push apps straight to the device, validate apps, and debug them as they run on the device.

+ +

Unit Testing

+ +

Unit tests are extremely valuable when testing on different devices and builds. jQuery's QUnit is a popular client-side testing utility, but you can use any set of testing tools you'd like.

+ +

Installing Firefox OS on a Device

+ +

Since Firefox OS is an open source platform, code and tools are available to build and install Firefox OS on your own device. Build and installation instructions, as well as notes on what devices it can be installed on, can be found on MDN.

+ +

Dedicated Firefox OS developer preview devices are also available: read our Developer preview phone page for more information.

+ +

App benyújtása és terjesztése

+ +

Once your app is complete, you can host it yourself like a standard web site or app (read Self-publishing apps for more information), or it can be submitted to the Firefox Marketplace. Your app's manifest will be validated and you may choose which devices your app will support (e.g. Firefox OS, Desktop Firefox, Firefox Mobile, Firefox Tablet). Once validated, you can add additional details about your app (screenshots, descriptions, price, etc.) and officially submit the app for listing within the Marketplace. Once approved, your app is available to the world for purchase and installation.

+ +

More Marketplace & Listing Information

+ +
    +
  1. Submitting an App to the Firefox OS Marketplace
  2. +
  3. Marketplace Review Criteria
  4. +
  5. App Submission Video Walkthrough
  6. +
+
diff --git a/files/hu/archive/b2g_os/quickstart/index.html b/files/hu/archive/b2g_os/quickstart/index.html new file mode 100644 index 0000000000..ebe1f7c220 --- /dev/null +++ b/files/hu/archive/b2g_os/quickstart/index.html @@ -0,0 +1,49 @@ +--- +title: Build +slug: Archive/B2G_OS/Quickstart +tags: + - NeedsTranslation + - TopicStub +translation_of: Archive/B2G_OS/Quickstart +--- +
+

Quickstart information on coding open web apps.

+
+
+
+ Introduction to open web apps
+
+ What are open web apps? How they differ from regular web pages? Why is this significant? This article aims to answer these questions and more.
+
+ Your first app
+
+ This article takes you through the basic steps and additional knowledge on top of regular web development required to create installable open web apps.
+
+ Introduction to Firefox OS
+
+ An introduction to Firefox OS, Mozilla's new open web app-based mobile platform.
+
+ Introduction to manifests
+
+ An FAQ designed to answer any questions you may have about manifests, hosting apps, origins, and other such topics.
+
+ App development for web developers
+
+ If you're a web developer, how do open web apps differ from what you're used to? This article explains all.
+
+ App development for mobile developers
+
+ If you're a native mobile application developer, what advantages can open web apps bring to you, and how do they differ from what you are used to? Here are some ideas.
+
+ Developing app functionality
+
+ This page talks about the kinds of different functionality that you might want to build into your apps, with links to further information.
+
+ Payments
+
+ How do you build functionality to make people pay for installing your open web apps? Here is the lowdown.
+
+ App tools
+
+ Last for this section, we provide some links to more information on the tools available to help you develop great open web apps.
+
diff --git a/files/hu/archive/b2g_os/releases/2.0/index.html b/files/hu/archive/b2g_os/releases/2.0/index.html new file mode 100644 index 0000000000..752d0cb316 --- /dev/null +++ b/files/hu/archive/b2g_os/releases/2.0/index.html @@ -0,0 +1,112 @@ +--- +title: Firefox OS 2.0 for developers +slug: Archive/B2G_OS/Releases/2.0 +translation_of: Archive/B2G_OS/Releases/2.0 +--- +
+

This page details the developer features newly implemented in Gecko that are specific to Firefox OS 2.0.

+
+ +
+

Firefox OS 2.0's Gecko component is based on Firefox 31/32.

+
+ +

New product features

+ +

This section provides a summary of the new features available in Firefox OS 2.0. For more details on specific platform changes (API additions, etc.), see the Platform additions in detail section.

+ +
+
NFC
+
This release includes support for device-to-device content sharing support with NFC (Near Field Communication). You can pair your device with another, then swipe to share your contacts, media, or favorite URLs with others.
+
Telephony
+
Firefox OS now supports both IPv4 and IPv6 addresses in the network manager.
+
Find My Device
+
If you’ve lost your Firefox OS smartphone, Find My Device can help you find it (see the http://find.firefox.com website). You can see it on a map, make it play a sound and have it display a message. You can also remotely lock it or delete your personal info. To get started, create a Firefox Account (Settings > Firefox Accounts on your device) and enable Find My Device (Settings > Find My Device).
+
Media
+
You can now create your own ringtones using your own music collection, or songs you download from the Web.
+
Camera
+
The Camera app now supports various focus modes: Touch, Continuous Auto and Face tracking.
+
Productivity
+
We've done a visual refresh of the Email, Calender, and Clock apps.
+
Homescreen
+
Firefox OS 2.0 introduces a simpler vertical-scrolling homescreen with larger icons.
+
Edge-gesture app switching
+
Edge gestures are now available for switching between apps (swipe your thumb from the left edge of the screen to the right and vice versa, to switch between multiple open apps.)
+
+ +

New partner features

+ +
+
E.ME integration
+
E.ME integration provides direct access to web apps while configurable search providers can search the web at the same time.
+
+ +

New DevTools features

+ +

The Firefox Developer Tools have had a large number of features added in Firefox versions 31 and 32; these aren't Firefox OS-specific, but you can take advantage of them when debugging your Firefox OS apps through WebIDE. To find out more, read:

+ + + +

Platform additions in detail

+ +
+

Note: Our list here includes features most important to Firefox OS. For an expanded list of general Gecko feature additions (which are generally also present in Firefox OS 2.0), consult the Firefox 31 release notes for developers and Firefox 32 release notes for developers.

+
+ +

Web API

+ + + +

CSS

+ + + +

Technology support improvements

+ + + +

Older versions

+ +

+ +

diff --git a/files/hu/archive/b2g_os/releases/index.html b/files/hu/archive/b2g_os/releases/index.html new file mode 100644 index 0000000000..3edbcd4c75 --- /dev/null +++ b/files/hu/archive/b2g_os/releases/index.html @@ -0,0 +1,24 @@ +--- +title: Firefox OS developer release notes +slug: Archive/B2G_OS/Releases +tags: + - Firefox OS + - NeedsTranslation + - TopicStub +translation_of: Archive/B2G_OS/Releases +--- +

Firefox OS release notes by version

+

This section provides articles covering each new release of Gaia and Gecko for Firefox OS, explaining what features were added and bugs eliminated in each update. There is also a linked summary table showing what APIs are supported by each version of Firefox OS.

+
+ {{ListSubpages("",1,0,1)}}
+

Other supporting information

+
+
+ Firefox OS API support table
+
+ Lists the different APIs available, and what versions of Firefox have support for them.
+
+ App permissions
+
+ Lists hosted, privileged and certified APIs, along with information on the permissions they need to have set in the App Manifest of your installable apps, such as the manifest permission name, app type required, description, access property, and default permission.
+
diff --git a/files/hu/archive/b2g_os/simulator/index.html b/files/hu/archive/b2g_os/simulator/index.html new file mode 100644 index 0000000000..96c17a6033 --- /dev/null +++ b/files/hu/archive/b2g_os/simulator/index.html @@ -0,0 +1,88 @@ +--- +title: Firefox OS Simulator +slug: Archive/B2G_OS/Simulator +translation_of: Archive/B2G_OS/Simulator +--- +
+

This page describes the Firefox OS Simulator for developers targeting Firefox OS 1.2 or later. If you're developing apps for Firefox OS 1.1, then you should check out the documentation for the Firefox OS 1.1 Simulator instead.

+
+ +

The Firefox OS Simulator is a version of the higher layers of Firefox OS that simulates a Firefox OS device, but runs on the desktop. This means that in many cases, you don't need a real device to test and debug your app. It runs in a window the same size as a Firefox OS device, includes the Firefox OS user interface and built-in apps, and simulates many of the Firefox OS device APIs.

+ +

The Simulator is packaged and distributed as a Firefox add-on. Once you've downloaded it and installed it in Firefox, you can run it, push apps to it, and attach the developer tools to it using the App Manager tool or WebIDE.

+ +

Installation

+ +

To install the simulator, use WebIDE's Manage Simulators pane (available as part of Firefox 33 and onwards). Multiple versions are available, and you are advised to install them all, for maximum flexibility.

+ +

To start the Simulator, you choose it from WebIDE's runtime list. For more details, see the instructions in the WebIDE documentation. Once the Simulator's running, you can push apps to it and debug them using the WebIDE, just as you can with a real device.

+ +

If you are using the App Manager (an older tool available prior to the WebIDE), you can install a simulator via the following button:

+ +

Install Simulator

+ +

The Simulator UI

+ +

The Simulator appears as a separate window, sized so the simulated screen area is 320x480 pixels. To simulate touch events you can click the mouse button and drag while holding the button down. So by clicking and dragging right-to-left from the Home Screen, you'll see the built-in apps, as well as any apps you have added:

+ +

+ +

The Simulator has two buttons in a toolbar at the bottom:

+ + + +

Limitations of the Simulator

+ +

Note that the Firefox OS Simulator isn't a perfect simulation.

+ +

Hardware limitations

+ +

Apart from screen size, the Simulator does not simulate the hardware limitations of a Firefox OS device such as available memory or CPU speed.

+ +

Audio/video codecs

+ +

The following codecs depend on hardware-accelerated decoding and are therefore not yet supported:

+ + + +

This means it isn't possible to use the Simulator to test video playback in apps and on websites like Youtube that rely on these codecs.

+ +

Unsupported APIs

+ +

Certain APIs that work on the device won't work on the Simulator, generally because the supporting hardware is not available on the desktop. We've implemented simulations for some APIs such as geolocation, and expect to add more in future releases. However, at the moment the following APIs are not supported. Using them might throw errors or just return incorrect results:

+ + + +

Getting help

+ +

If you have a question, try asking us on the dev-developer-tools mailing list or on #devtools on irc.mozilla.org.

+ +

How to enable verbose logging

+ +

You can see messages logged from your app in the Web Console, which you can attach to your app using the WebIDE. If you want to catch early messages happening during app startup, before the console gets connected and working, you can enable verbose logging in the Simulator.

+ +

Visit about:config and create a new preference. The preference name is different for each version of the Simulator:

+ + + +

Set it to the string value "all", and disable, then reenable, the add-on in the Add-on Manager. Now extra messages about the Simulator's operation will appear in the Browser Console.

diff --git "a/files/hu/archive/b2g_os/teljes\303\255tm\303\251ny/index.html" "b/files/hu/archive/b2g_os/teljes\303\255tm\303\251ny/index.html" new file mode 100644 index 0000000000..843627ac3c --- /dev/null +++ "b/files/hu/archive/b2g_os/teljes\303\255tm\303\251ny/index.html" @@ -0,0 +1,146 @@ +--- +title: Teljesítmény +slug: Archive/B2G_OS/Teljesítmény +translation_of: Web/Performance/Fundamentals +--- +

Performance is a broad topic. This document gives a brief overview of what Firefox OS was designed and optimized for. It also introduces tools and processes developers can use to improve the performance of their code.

+

What is performance?

+

Performance is entirely what is perceived by users. Users provide inputs to the system through touch, movement, and speech. In return, they perceive outputs in the form of visual, tactile, and auditory feedback. Performance is the quality of outputs in response to these inputs.

+

Code that is optimized for a target other than user-perceived performance (hereafter UPP) will lose in competition against code that is, all other things being equal. Users will prefer an application that's responsive and smooth while only processing, say, 1,000 database transactions a second, over another that processes 100,000,000 a second but is choppy and unresponsive.

+

Of course, that's not to say it's pointless to optimize metrics like the number of database transactions processed per second; it almost always is. The point is that these metrics are secondary, proximate to real UPP targets.

+

There are a few key performance metrics. The first is "responsiveness". Responsiveness is simply the speed with which the system provides outputs (possibly multiple ones) in response to user inputs. For example, when a user taps the screen, they expect the pixels to change in a certain way. The time elapsed between the "tap" gesture and the change in pixels is the responsiveness metric for that interaction.

+

Responsiveness sometimes involves multiple stages of feedback. Application launch is one particularly important case, which is discussed in more detail below.

+

Responsiveness is important for the simple reason that no one wants to be ignored. Every millisecond that elapses between the user providing input to the system and the system finally responding with output is a millisecond that the user is being ignored. Being ignored engenders frustration and anger.

+

The next key metric is "framerate": the rate at which the system changes pixels displayed to the user. This is a familiar concept; everyone prefers, say, games that display 60 frames per second over ones that display 10 frames per second, even if they can't explain why.

+

Framerate is important as a "quality of service" metric. Computer displays are designed to "fool" user's eyes, by delivering photons to them that mimic reality. For example, document readers display text by creating arrangements of display pixels that are designed to create photons that strike users' retinas in the same patterns as photons reflected off crisply-struck text on physical paper.

+

In reality, motion is "continuous" (as inferred by our brains anyway); it's not jerky and discrete, but rather "updates" smoothly. (Strobe lights are fun because they turn that upside down, starving our brains of inputs to create the illusion of discrete reality.) On a computer display, a higher framerate simply allows the display to imitate reality more faithfully.

+

(An interesting aside is that humans are generally not able to perceive differences in framerate above 60Hz. That's why most modern electronic displays are designed to refresh at that rate. A television probably looks choppy and unrealistic to a hummingbird, for example.)

+

Memory usage is another key metric. Unlike responsiveness and framerate, users don't directly perceive memory usage. However, memory usage is a close approximation to "user state". An ideal system would maintain 100% of user state at all times: all applications in the system would run simultaneously, and all applications would retain the state created by the user the last time the user interacted with the application. (Application state is stored in computer memory, which is why the approximation is close.)

+

An important corollary of this is contrary to popular belief: a well-designed system should not be optimized to maximize the amount of free memory. Memory is a resource, and free memory is a unused resource. Rather, a well-designed system should be optimized to use as much memory as possible in service of maintaining user state, while meeting other UPP goals.

+

Optimizing a system to use memory doesn't mean it should waste memory. Using more memory than is required to maintain some particular user state is wasting a resource that could be used to retain some other user state.

+

In reality, no system can maintain all user state. Intelligently allocating memory to user state is an important concern that's discussed in more detail below.

+

The final metric discussed here is power usage. Like memory usage, users don't directly perceive power usage. Users perceive power usage indirectly by their devices being able to maintain all other UPP goals for a longer duration. In service of meeting UPP goals, the system must use only the minimum amount of power required.

+

The remainder of this document will discuss performance in terms of these metrics.

+

Platform performance

+

This section provides a brief overview of how Firefox OS contributes to performance generally, below the level of all applications. From a developer's or user's perspective, this answers the question, what does the platform do for you?

+

This section assumes the reader is familiar with the basic conceptual design of Firefox OS.

+

Firefox OS is optimized for applications built with web technologies, HTML/CSS/JavaScript and so on. Except for a handful of basic system services, all the code that runs in Firefox OS is web applications and the Gecko engine. Even the operating system window manager is written in HTML/CSS/JS.

+

Because the core operating system is built with the same web technologies that applications are built with, the performance of those technologies is critical. There's no "escape hatch". This greatly benefits developers because all the optimizations that enable a performant OS window manager, for example, are available to third-party applications as well. There's no "magic performance sauce" available only to preinstalled code.

+

The web platform provides many tools, some better suited for particular jobs than others. All application logic is written in JavaScript. For displaying graphics, developers can choose between the high-level declarative languages of HTML/CSS, or use low-level imperative interfaces offered by the canvas element.

+

HTML/CSS greatly increase productivity, sometimes at the cost of pixel-level control over rendering or a few frames per second. Text and images are reflowed automatically, the system theme is applied to UI elements by default, and "built-in" support is provided for some use cases developers may not think about initially, like different-resolution displays or right-to-left languages.

+

The canvas element offers a pixel buffer directly to developers to draw on. This gives pixel-level control over rendering and precise control of framerate to developers. But it comes at the expense of extra work needed to deal with multiple resolutions and orientations, right-to-left languages, and so forth. Developers draw to canvases using either a familiar 2D drawing API, or WebGL, a "close to the metal" binding that mostly follows OpenGL ES 2.0.

+

(Somewhere "in between" HTML/CSS and canvas is SVG, which is beyond the scope of this document.)

+

The Gecko JavaScript engine supports just-in-time (JIT) compilation. This enables application logic to perform comparably to other virtual machines, such as Java virtual machines, and in some cases close to "native code".

+

The graphics pipeline in Gecko underlying HTML/CSS and canvas is optimized in several ways. The HTML/CSS layout and graphics code in Gecko minimizes invalidation and repainting for common cases likes scrolling; developers get this support "for free". Pixel buffers painted by both Gecko "automatically" and applications to canvas "manually" minimize copies when being drawn to the display framebuffer. This is done by avoiding intermediate surfaces where they would create overhead (such as per-application "back buffers" in many other operating systems), and by using special memory for graphics buffers that can be directly accessed by the compositor hardware. Complex scenes are rendered using the device's GPU for maximum performance. To improve power usage, simple scenes are rendered using special dedicated composition hardware, while the GPU idles or turns off.

+

Fully static content is the exception rather than the rule for rich applications. Rich applications use dynamic content with animations, transitions, and other effects. Transitions and animations are particularly important to applications. Developers can use CSS to declare even complicated transitions and animations with a simple, high-level syntax. In turn, Gecko's graphics pipeline is highly optimized to render common animations efficiently. Common-case animations are "offloaded" to the system compositor, which can render them both performantly and power efficiently.

+

The runtime performance of applications is important, but just as important is their startup performance. Firefox OS improves startup experience in several ways.

+

Gecko is optimized to load a wide variety of content efficiently: the entire Web! Many years of improvements targeting this content, like parallel HTML parsing, intelligent scheduling of reflows and image decoding, clever layout algorithms, etc, translate just as well to improving web applications on Firefox OS. The content is written using the same technologies.

+

Each web application has its own instance of the Gecko rendering engine. Starting up this large, complicated engine is not free, and because of that, Firefox OS keeps around a preallocated copy of the engine in memory. When an app starts up, it takes over this preallocated copy and can immediately begin loading its application resources.

+

Applications "start" most quickly when they're already running. To this end, Firefox OS tries to keep as many applications running in the background as possible, while not regressing the user experience in foreground applications. This is implemented by intelligently prioritizing applications, and discarding background applications according to their priorities when memory is low. For example, it's more disruptive to a user if their currently-playing music player is discarded in the background, while their background calculator application keeps running. So, the music player is prioritized above the calculator automatically by Firefox OS and the calculator is discarded first when memory is low.

+

Firefox OS prevents applications that are running in the background from impacting the user experience of foreground applications through two mechanisms. First, timers created by background apps are "throttled" to run at a low frequency. Second, background applications are given a low CPU priority, so that foreground applications can get CPU time when they need it.

+

In addition to the above, Firefox OS includes several features designed to improve power usage that are common to mobile operating systems. The Firefox OS kernel will eagerly suspend the device for minimal power usage when the device is idle. Relatedly, ICs like the GPU, cellular radio, and Wifi radio are powered down when not being actively used. Firefox OS also takes advantage of hardware support for media decoding.

+

Application performance

+

This section is intended for developers asking the question: "how can I make my app fast"?

+

Startup performance

+

Application startup is punctuated by three user-perceived events, generally speaking. The first is the application "first paint": the point at which sufficient application resources have been loaded to paint an initial frame. Second is when the application becomes interactive; for example, users are able to tap a button and the application responds. The final event is "full load", for example when all the user's albums have been listed in a music player.

+

The key to fast startup is to keep two things in mind: UPP is all that matters, and there's a "critical path" to each user-perceived event above. The critical path is exactly and only the code that must run to produce the event.

+

For example, to paint an application's first frame that comprises visually some HTML and CSS to style that HTML, (i) the HTML must be parsed; (ii) the DOM for that HTML must be constructed; (iii) resources like images in that part of the DOM have to be loaded and decoded; (iv) the CSS styles must be applied to that DOM; (v) the styled document has to be reflowed. Nowhere in that list is "load the JS file needed for an uncommon menu"; "fetch and decode the image for the High Scores list"; etc. Those work items are not on the critical path to painting the first frame.

+

It seems obvious, but to reach a user-perceived startup event more quickly, the main "trick" is to just not run code that's off the critical path. Alternatively, shorten the critical path by simplifying the scene.

+

The web platform is highly dynamic. JavaScript is a dynamically-typed language, and the web platform allows loading code, HTML, CSS, images, and other resources dynamically. These features can be used to defer work at startup that's off the critical path, by loading the unnecessary content "lazily" some time after startup.

+

Another problem that can delay startup is idle time, caused by waiting on responses to requests like database loads. To avoid this problem, applications can "front load" the work by issuing requests as early as possible in startup. Then when the data is needed later, it's hopefully already been fetched and the application doesn't need to wait.

+

Relatedly, it's important to separate network requests for dynamic data from static content that can be cached locally. Locally-cached resources can be loaded much more quickly than they can be fetched over high-latency and lower-bandwidth mobile networks. Network requests should never be on the critical path to early application startup. Caching resources locally is also the only way applications can be used when "offline". Firefox OS allows applications to cache resources by either being "packaged" in a compressed ZIP file or "hosted" through HTML5 appcache. How to choose between these options for a particular type of application is beyond the scope of this document, but in general application packages provide optimal load performance; appcache is slower.

+

A few other hints are listed below:

+ +

Framerate

+

The first important consideration for achieving high framerate is to select the right tool for the job. Mostly static content that's scrolled and infrequently animated is usually best implemented with HTML/CSS. Highly dynamic content like games that need tight control over rendering, and don't need theming, is often best implemented with canvas.

+

For content drawn using canvas, it's up to the developer to hit framerate targets: they have direct control over what's drawn.

+

For HTML/CSS content, the path to high framerate is to use the right primitives. Firefox OS is highly optimized to scroll arbitrary content; this is usually not a concern. But often trading some generality and quality for speed, such as using a static rendering instead of a CSS radial gradient, can push scrolling framerate over a target. CSS media queries allow these compromises to be restricted only to devices that need them.

+

Many applications use transitions or animations through "pages", or "panels". For example, the user taps a "Settings" button to transition into an application configuration screen, or a settings menu "pops up". Firefox OS is highly optimized to transition and animate scenes that

+ +

Transitions and animations that adhere to these guidelines can be offloaded to the system compositor and run maximally efficiently.

+

To help diagnose low framerates, see the section below.

+

Memory and power usage

+

Improving memory and power usage is a similar problem to speeding up startup: don't do unnecessary work; use efficient data structures; lazily load uncommonly-used UI resources; ensure resources like images are optimized well.

+

Modern CPUs can enter a lower-power mode when mostly idle. Applications that constantly fire timers or keep unnecessary animations running prevent CPUs from entering low-power mode. Power-efficient applications don't do that.

+

When applications are sent to the background, a visibilitychange event is fired on their documents. This event is a developer's friend; applications should listen for it. As mentioned above, Firefox OS tries to keep as many applications running simultaneously as it can, but does have to discard applications sometimes. Applications that drop as many loaded resources as possible when sent to the background will use less memory and be less likely to be discarded. This in turn means they will "start up" faster (by virtue of already being running) and have better UPP.

+

Similarly, applications should prepare for the case when they + + are + discarded. To improve user-perceived memory usage, that is to say, making the user feel that more of their state is being preserved, applications should save the state needed to return the current view if discarded. If the user is editing an entry, for example, the state of the edit should be saved when entering the background.

+

Measuring performance and diagnosing problems

+

Before beginning to measure and diagnose performance problems, remember this:

+
+
+  
+
+ Must. Test. On. Device.
+
+  
+
+

A great strength of the web platform is that the same code written for "desktop" web browsers runs on Firefox OS on mobile devices. Developers should use this to improve productivity: develop on "desktops", in comfortable and productive environments, as much as possible.

+

But when it comes time to test performance, mobile devices must be used. Modern desktops can be more than 100x more powerful than mobile hardware. The lower-end the mobile hardware tested on, the better.

+

With that caveat, the sections below describe tools and processes for measuring and diagnosing performance issues.

+

Measuring performance

+

Firefox OS comes built-in with some convenient and easy-to-use tools that, when used properly, can be used to quickly measure performance. The first tool is the "framerate monitor". This can be enabled in the Firefox OS Settings application.

+

The framerate monitor continuously reports two numbers. The values reported are an average of recent results within a sliding window, meant to be "instantaneous" but fairly accurate. As such, both numbers are "guesses". The left number is the "composition rate": the estimated number of times per second Firefox OS is drawing frames to the hardware framebuffer. This is an estimate of the user-perceived framerate, and only an estimate. For example, the counter may report 60 compositions per second even if the screen is not changing. In that case the user-perceived framerate would be 0. However, when used with this caveat in mind and corroborated with other measurements, the monitor can be a useful and simple tool.

+

Screenshot of fps counter

+

The rightmost number is the "layer transaction rate", the estimated number of times per second processes are repainting and notifying the compositor. This number is mostly useful for Gecko platform engineers, but it should be less than or equal to the composition rate number on the left.

+

Firefox OS also has a tool that can help measure startup time, specifically the "first paint" time described above. This "time-to-load" tool can be enabled using the Settings application. The value shown by the tool is the elapsed time between when the most recent application was launched, and an estimate of the first time that application painted its UI. This number only approximates the real "first paint" time, and in particular underestimates it. However, lowering this number almost always correlates to improvements in real startup time, so it can be useful to quickly measure optimization ideas.

+

Screenshot of enabling ttl

+

For accurately measuring both startup times and responsiveness, a high-speed camera is indispensable. "High-speed" means that the camera can record 120 frames per second or above. The higher the capture rate, the more accurate the measurements that can be made. This may sound like exotic technology, but consumer models can be purchased for a few hundred US dollars.

+

Link to example video of high-speed capture that I can't upload

+

The measuring process with these cameras is simple: record the action to be studied, and then play back the capture and count the number of frames that elapse between the input (say, a tap gesture) and the desired output (pixels changing in some way). Divide the number of counted frames by the capture rate, and the resulting number is the measured duration.

+

Mozilla built an automated tool called Eideticker which operates on the same principle as described above. The difference is that Eideticker uses synthetic user input events and HDMI capture to measure durations. The code is available and can be used with any device with an HDMI output.

+

Measuring power can be more difficult. It's possible to jury-rig measurement apparatus with a soldering iron, but a good approximation of power usage can be gathered by observing CPU load. Simple command-line tools like |top| allow monitoring CPU usage continuously.

+

In general, when measuring performance, don't be proud! "Primitive technology" like a stopwatch or logging, when used effectively, can provide eminently usable data.

+

Diagnosing performance problems

+

If performance measurements show an application is below its targets, how can the underlying problem be diagnosed?

+

The first step of any performance work is to create a reproducible workload and reproducible measurement steps. Then gather baseline measurements, before any code changes are made. It seems obvious, but this is required to determine whether code changes actually improve performance! The measurement process selected isn't too important; what's important is that the process be (i) reproducible; (ii) realistic, in that it measures what users will perceive as closely as possible; (iii) precise as possible; (iv) accurate as possible. Even stopwatch timings can fit this spec.

+

Firefox OS includes two built-in tools for quickly diagnosing some performance issues. The first is a render mode called "paint flashing". In this mode, every time a region of the screen is painted by Gecko, Gecko blits a random translucent color over the painted region. Ideally, only parts of the screen that visually change between frames will "flash" with a new color. But sometimes more area than is needed is repainted, causing large areas to "flash". This symptom may indicate that application code is forcing too much of its scene to update. It may also indicate bugs in Gecko itself.

+

Enable paint flashing

+

Paint flashing after scrolling down from previous image

+

The second tool is called "animation logging", and can also be enabled in Settings. This tool tries to help developers understand why animations are not offloaded to the compositor to be run efficiently as possible. It reports "bugs" like trying to animate elements that are too large, or trying to animate CSS properties that can't be offloaded.

+

Enable animation logging

+

Start of animation not offloaded

+
I/Gecko   ( 5644): Performance warning: Async animation disabled because frame size (1280, 410) is bigger than the viewport (360, 518) [div with id 'views']
+
+

End of animation not offloaded

+
+

A common pitfall is to animate left/top/right/bottom properties instead of using CSS transforms to achieve the same effect. For a variety of reasons, the semantics of transforms make them easier to offload, but left/top/right/bottom are much more difficult. Animation logging will report this.

+
+

These tools can help quickly assess a performance problem, but they often show only what developers should be "looking for": hints at deeper problems. When more information is required, the Gecko Profiler can be used. A full description of the profiler is beyond the scope of this document; see [here]. Briefly, the profiler shows mixed JavaScript/C++ "samples" of what all Firefox OS processes are doing over a rolling time interval. Developers can use these profiles to see what their code and Gecko itself are doing. Warnings are built into the profiler UI for many common pitfalls like excessive garbage collection (caused by creating too many JS objects), and forcing "synchronous reflows". Sync reflows are bad because Gecko is optimized to do expensive work like reflows in big batches, when needed. Forced reflows throw off this "schedule", and can cause more work to be done than necessary.

+

Similarly, advanced users may wish to use a whole-system profiler like the linux |perf| tool. This is mostly useful for platform engineers, though.

+

As with measuring performance, don't be proud about tools used to diagnose it! A few well-placed Date.now() calls with logging can often provide a quick and accurate answer.

+

Finally, the only way to keep improving performance is to not regress it. The only way to not regress performance is to test it, preferably with automated tests. A full discussion of that topic is beyond the scope of this document, though.

+

Paris Firefox OS Performance & Optimization Workshop, March 4 - 8, 2013

+

To illustrate these concepts here are some videos and slides from the Paris Workshop dedicated to performances and optimizations.

+

Part 1: Technical basics and more (Gabriele & Thomas)

+ +

Part 2: Performances in a UX point of view (Josh)

+

Part 3: Performances measurement & automation (Julien & Anthony)

diff --git a/files/hu/archive/b2g_os/using_the_app_manager/index.html b/files/hu/archive/b2g_os/using_the_app_manager/index.html new file mode 100644 index 0000000000..b18aa26621 --- /dev/null +++ b/files/hu/archive/b2g_os/using_the_app_manager/index.html @@ -0,0 +1,281 @@ +--- +title: Using the App Manager +slug: Archive/B2G_OS/Using_the_App_Manager +translation_of: Archive/B2G_OS/Using_the_App_Manager +--- +
+

The App Manager is a tool for Firefox Desktop which provides a number of useful tools to help developers test, deploy and debug HTML5 web apps on Firefox OS phones & Simulator, directly from Firefox browser. This page documents how to use the App Manager.

+ +

App Manager is available for Firefox OS 1.2 or later, lower versions are supported in Firefox OS 1.1 Simulator. The App Manager is being replaced by the WebIDE, starting from Firefox 33. The WebIDE provides all the features of the App Manager and also features an editing environment to create and develop Firefox OS apps.

+
+ +

{{EmbedYouTube("z1Bxg1UJVf0")}}

+ +

The App Manager is composed of:

+ + + +

Quick setup

+ +

This section is designed to get you up and running as soon as possible; if you need some more detail please skip forward to the {{ anch("Device and system configuration") }} section and start reading from there.  Also see the {{ anch("Troubleshooting") }} section for help if you are having trouble.

+ +
    +
  1. Make sure you have Firefox Desktop 26+ installed
  2. +
  3. Open the App Manager (in the URL bar, type about:app-manager, or go to Tools > Web Developer > App Manager in your Firefox menu.) This should appear in a new browser tab.
  4. +
  5. If you don't have a real device: +
      +
    1. Install the Firefox OS Simulator add-on, then go back to the App Manager tab of your browser.
    2. +
    3. In App Manager's bottom toolbar, click on Start Simulator, then click on the name of the installed simulator, which should appear there.
    4. +
    +
  6. +
  7. If you have a real device: +
      +
    1. Make sure your device is running Firefox OS 1.2+
    2. +
    3. On Windows, make sure to install the drivers provided by your phone manufacturer
    4. +
    5. In the Settings of your device, disable Screen Lock (Settings > Phone lock > Lock Screen) and enable Remote Debugging (Settings > Device information > More information > Developer)
    6. +
    7. Install the ADB Helper add-on in Firefox Desktop
    8. +
    9. Connect your device to your machine via a USB cable
    10. +
    11. You should see the name of your device in the App Manager's bottom bar. Click on it.
    12. +
    +
  8. +
  9. The bottom bar should show "Connected to: xxx"
  10. +
  11. Click on the Apps panel and add an app (packaged or hosted)
  12. +
  13. The Refresh button validates your app and installs it on the Simulator/Device
  14. +
  15. The Debug button connects the developer tools to the running app
  16. +
  17. See the {{ anch("Troubleshooting") }} section for help if you are having trouble
  18. +
+ +

Device and system configuration

+ +

The first thing you'll need to do when using the App Manager is make sure your system and phone are set up correctly. This section will run through all the steps required.

+ +

Firefox OS 1.2+ required

+ +

Make sure your device is running Firefox OS 1.2/Boot2Gecko 1.2 or higher. To check which version of Firefox OS the device is runing, go to Settings > Device Information > Software.

+ +

If you don't have a high enough version installed, depending on what phone you have you will need to either install an available nightly build of Firefox 1.2+, or configure and build it yourself from source.

+ +

Builds available:

+ + + +
+

Note: To build your own Firefox OS 1.2+ distribution, follow the instructions located at Building and installing Firefox OS, starting with Firefox OS build prerequisites.

+
+ +

Remote debugging

+ +

Next, you need to enable remote debugging in Firefox OS. To do so, go to Settings > Device information > More information > Developer and check the Remote Debugging checkbox.

+ +

ADB or ADB helper

+ +

The process uses the Android Debug Bridge (ADB) to handle the device-computer connection and communication. There are two options for running ADB:

+ + + +
+

Note: There's no need to run this command if you installed the ADB Helper Add-on.

+
+ +

Connecting your device to the App Manager

+ +

With all your configuration done, it's now time to plug your device into your computer and start the App Manager:

+ +
    +
  1. Plug the device into your computer via USB.
  2. +
  3. Disable Screen lock on your device by going to Settings > Screen Lock and unchecking the Lock Screen checkbox. This is a good idea because when the screen gets locked, the phone connection gets lost, meaning it is no longer available for debugging.
  4. +
  5. Start the App Manager — In Firefox Desktop select the Tools > Web Developer > App Manager menu option, or type about:app-manager in the URL bar.
  6. +
  7. At the bottom of the App Manager tab, you will see a connection status bar (see screenshot below). You should be able to connect your device by clicking the "Connect to localhost:6000" button.
  8. +
  9. If this works successfully, a prompt should appear on your device: "An incoming request to permit remote debugging connection was detected. Allow connection?". Tap the OK button (You may also have to press the power button on the phone so you can see the prompt.) The connection status bar should update to say "Connected to B2G", with a Disconnect button available to press if you want to cancel the connection.
  10. +
+ +

+ +
+

Note: The other controls in the connection status bar allow you to connect a simulator to the App Manager, which we cover in the next section, below, and change the port that the connection happens on. If you change the port, you'll also need to enable port forwarding for this port as well, as instructed in the {{anch("Enable port forwarding")}} section, above.

+
+ +

Using a Firefox OS Simulator Add-on

+ +

If you haven't got a real device available to use with App Manager, you can still try it out using a Firefox OS Simulator Add-on. To start off, install the simulator with the following button (multiple versions are available; you are advised to install them all, for maximum flexibility):

+ +

Install Simulator

+ + +

Once you've installed the simulator(s), you need to go to about:app-manager to see the connection status bar at the bottom of the App Manager tab, and click the "Start simulator" button. At least three buttons will appear:

+ + + +
+

Note: The Firefox OS 1.5 Simulator has been removed, as 1.5 was changed to 2.0. If you have the Firefox OS 1.5 Simulator installed, it won't automatically update to 2.0, so you should uninstall 1.5 and install 2.0 instead. The Firefox OS 2.0 simulator will then automatically update.

+
+ +
+

Note: The Firefox OS 1.2 Simulator has been removed, as no phones are likely to be released with version 1.2 installed — this version is therefore of limited value, and it makes more sense to spend your time debugging on other versions.

+
+ +

Running custom builds in the App Manager

+ +

Note that you can run custom B2G Desktop and Gaia/Gecko builds in the App Manager via the simulator. Read Running custom Firefox OS/Gaia builds in the App Manager for instructions on how to do this.

+ +

Apps panel: Test and debug Firefox OS apps

+ +

Now that everything is working, let's review the functionality available inside the App Manager, starting with the Apps panel. From here, you can import an existing app to push onto your device, for testing and debugging:

+ + + +

Information about your app should appear on the right hand side of the window, as seen below:

+ +

+ +

Manifest editor

+ +

From Firefox 28 onwards, the Apps Panel includes an editor for the app manifest:

+ +

+ +

Debugging

+ +

Clicking on "Update" will update (install) the app on the device. Clicking on "debug" will connect a toolbox to the app, allowing you to debug its code directly:

+ +

+ +
+

You'll enjoy playing around with the toolbox — try altering the DOM, CSS etc. and you'll see the updates reflected on the device in realtime. Such updates will be saved on the installed app code; you'll see them next time you open the app on the device.

+
+ +

Before Firefox 28, the tools are launched in a separate window. From Firefox 28 onwards, the tools are launched in a separate tab in the App Manager itself, alongside the Apps and Device tabs. The tab is given your app's icon so it's easy to find:

+ +

+ +

Errors

+ +

If an app was not added successfully — for example if the URL was incorrect, or you selected a packaged app folder — an entry will be added to the page for this app, but this will include error information.

+ +

+ +

You can also delete an app from this view, by hovering over the App name/description on the left of the window, and pressing the "X" button that appears in each case. This however doesn't remove the app from the device. To do that you need to manually remove the app using the device itself.

+ +

Device panel

+ +

The Device tab displays information about the connected device. From the "Installed Apps" window, apps on the device can be started and debugged.

+ +

+ +
+

Note: Certified Apps are not listed by default. See how to debug certified apps.

+
+ +

The "Permissions" window shows the required privileges for different Web APIs on the current device:

+ +

+ +

Finally, you can take a screenshot of the current device display by clicking the "Screenshot" button. The screenshot appears in a new tab on Firefox, and from there you can save or discard it as you wish.

+ +

Debugging Certified Apps

+ +

Currently only devices running a development build of Firefox OS 1.2+ are capable of debugging certified apps. If you have a development build, you can enable certified app debugging by changing the pref devtools.debugger.forbid-certified-apps to false in your profile. To do this, follow the steps below:

+ +

Using a real device

+ +
    +
  1. +

    On your computer, enter the following command in Terminal/console to enter your device's filesystem via the shell:

    + +
    adb shell
    + +

    Your prompt should change to root@android.

    +
  2. +
  3. +

    Next, stop B2G running using the following command:

    + +
    stop b2g
    +
  4. +
  5. +

    Navigate to the following directory:

    + +
    cd /data/b2g/mozilla/*.default/
    +
  6. +
  7. +

    Here, update the prefs.js file with the following line:

    + +
    echo 'user_pref("devtools.debugger.forbid-certified-apps", false);' >> prefs.js
    +
  8. +
  9. +

    After you've finished editing and saving the file, start B2G again using the following command:

    + +
    start b2g
    +
  10. +
  11. +

    Exit the android filesystem using the exit command; this will return you to your normal terminal prompt.

    +
  12. +
  13. +

    Next, reconnect to the App Manager and you should see certified apps appear for debugging.

    +
  14. +
+ +

Using the B2G desktop client

+ +

With the B2G desktop client, the preference is already defined in your profile in greprefs.js, located at the root of your B2G desktop client folder. Stop your B2G desktop client and edit the file to turn the devtools.debugger.forbid-certified-apps preference to false. Then restart the B2G client and connect the App Manager. You should now see all applications.

+ +
+

Note: If you want to add this preference to your Gaia build you can run make DEVICE_DEBUG=1 reset-gaia.

+
+ +

Troubleshooting

+ +

If the device is not recognized:

+ + + +

Can't connect your device to the App Manager or start the simulator? Let us know or file a bug. and

diff --git a/files/hu/archive/index.html b/files/hu/archive/index.html new file mode 100644 index 0000000000..0b020071da --- /dev/null +++ b/files/hu/archive/index.html @@ -0,0 +1,20 @@ +--- +title: Archive of obsolete content +slug: Archive +translation_of: Archive +--- +

(hu translation)

+ +

Here at MDN, we try to avoid outright deleting content that might be useful to people targeting legacy platforms, operating systems, and browsers. Perhaps your target audience is people that are using older hardware, for example, and can't upgrade to the latest and greatest browsers. Or for "reasons," your company is required to use very old software and you need to build Web content that runs on that software. Or perhaps you're just curious about the history of an obsolete feature or API, and how it worked.

+ +

There are many reasons older documentation can be useful. So, we've established this area into which we can archive older documentation. Material in this Archived content zone should not be used for building new Web sites or apps for modern browsers. It's here for historical reference only.

+ +
+

Note to writers: We need to try to keep the subpages here organized instead of all dumped into one large folder. Try to create subtrees for categories of material. Also, only move pages here that are extremely obsolete. If anyone might realistically need the information in a living product, it may not be appropriate to move it here. In general, it may be best to discuss it in the MDN Web Docs chat room before moving content here.

+
+ +

{{SubpagesWithSummaries}}

+ + + +

{{ListSubpages("/en-US/docs/Archive", 2, 0, 1)}}

diff --git "a/files/hu/bevezet\303\251s_a_dokumentumobjektum-modellbe/index.html" "b/files/hu/bevezet\303\251s_a_dokumentumobjektum-modellbe/index.html" new file mode 100644 index 0000000000..62215dd5d8 --- /dev/null +++ "b/files/hu/bevezet\303\251s_a_dokumentumobjektum-modellbe/index.html" @@ -0,0 +1,18 @@ +--- +title: Bevezetés a dokumentumobjektum-modellbe +slug: Bevezetés_a_dokumentumobjektum-modellbe +tags: + - DOM + - minden_kategória +translation_of: Web/API/Document_Object_Model +--- +

Mi a DOM?

+

A Dokumentumobjektum-modell (DOM) egy API HTML és XML dokumentumokhoz. A dokumentum szerkezetét modellezi és lehetővé teszi annak tartalmi és vizulális változtatását. Lényegében összeköttetést képez a weblapok és a script- vagy programozási nyelvek között.

+

Minden tulajdonságot, metódust és eseményt, ami a webfejlesztő számára rendelkezésre áll a weboldalak szerkesztése és változtatása során, objektumokba rendszerez. (pl. a document objektum jelöli a dokumentumot, a table objektum jelöli a HTML táblázatokat, stb.) Ezek az objektumok hozzáférhetőek a script-nyelvek számára az újabb böngészőkben.

+

A DOM-ot leggyakrabban JavaScript-tel együtt használják. Azaz a kód JavaScript-ben van írva, de a DOM-ot használja a weboldalhoz és elemeihez való hozzáférés során.

+

A DOM-ot azonban úgy tervezték hogy független legyen minden programozási nyelvtől, ezért a dokumentum szerkezeti modellje egyetlen, önálló és konzisztens API-ból érhető el. Bár a továbbiakban a JavaScriptre fogunk összpontosítani, a DOM-ot tkp. bármilyen nyelvből elérhetjük.

+

A World Wide Web Consortium (W3C) meghatározta a standard DOM-ot, amit W3C DOM-nak neveznek. Ma már a legfontosabb böngészők ezt támogatják, ezzel lehetővé teszik browserfüggetlen alkalmazások létrehozását.

+

Miért fontos a DOM-támogatás a Mozilla-ban?

+

A "dinamikus HTML" (DHTML) fogalmat szokták használni a HTML, CSS és a scriptek kombinációjára, amivel pl. animációt helyezhetünk el weboldalunkon. A W3C DOM munkacsoportjában keményen dolgoznak azon, hogy nyelvsemleges megoldásokat tudjanak szabványosítani (lásd még W3C FAQ). Mivel a Mozillát webalkalmazás-platformnak ("Web Application Platform") tervezték, a DOM támogatása az egyik leggyakrabban felmerülő követelmény és a elengedhetetlen megfelelni neki, ha a Mozilla életképes alternatíva kíván maradni a többi böngésző mellett.

+

Talán még ennél is fontosabb, hogy a Mozilla (valamint a Firefox és a Thunderbird) felhasználói felülete XUL (XML User interface Language - XML felhasználói felületi nyelv) használatára épül. A Mozilla felhasználói tehát a DOM segítségével dinamikusan változtatni tudják a saját felhasználói felületüket is.

+

{{ languages( { "en": "en/About_the_Document_Object_Model", "es": "es/Acerca_del_Modelo_de_Objetos_del_Documento", "fr": "fr/\u00c0_propos_du_Document_Object_Model", "ja": "ja/About_the_Document_Object_Model", "ko": "ko/About_the_Document_Object_Model", "pl": "pl/O_modelu_obiektowym_dokumentu", "zh-cn": "cn/\u5173\u4e8e\u6587\u6863\u5bf9\u8c61\u6a21\u578b", "ru": "ru/\u041e\u0431_\u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0439_\u043c\u043e\u0434\u0435\u043b\u0438_\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430" } ) }}

diff --git a/files/hu/css/css_grid_layout/index.html b/files/hu/css/css_grid_layout/index.html new file mode 100644 index 0000000000..35aa2b57f7 --- /dev/null +++ b/files/hu/css/css_grid_layout/index.html @@ -0,0 +1,249 @@ +--- +title: CSS Grid Layout +slug: CSS/CSS_Grid_Layout +translation_of: Web/CSS/CSS_Grid_Layout +--- +

A CSS Grid Layout kiemlekedő feladatot lát el egy adott HTML oldal fő részeinek meghatározásakor, illetve az oldalon elhelyezkező elemek méretének, pozíciójának és egymáshoz való viszonyának definiálasakor.

+ +

Ahogyan a táblázatok esetében is, a grid layout lehetővé teszi a szerkesztő számára, hogy az egyes elemeket oszlopokba és sorokba rendezze. Emellett jó tudni, hogy más jellegű felépítések megvalósítása is lehetséges a CSS grid segítségével, még akár könyebben is, mint a táblázatokkal. Például, egy grid konténer gyermek elemei képesek egymást pozícionálni. Ennek következtében képesek egymást fedni, hasonlóan a CSS-sel pozícionált elemekhez.

+ +

Egyszerű példa

+ +

Az alábbi példa egy három oszlopos felépítést valósít meg, amelyben minden sor automatikusan minimum 100 pixel magas lesz és maximum akkora, mint amekkora helyet automatikusan elfoglalna. A grid rendszeren belül található elemek, mind egyénileg definiált helyet foglalnak el.

+ +
+ + +

HTML

+ +
<div class="wrapper">
+  <div class="one">One</div>
+  <div class="two">Two</div>
+  <div class="three">Three</div>
+  <div class="four">Four</div>
+  <div class="five">Five</div>
+  <div class="six">Six</div>
+</div>
+ +

CSS

+ +
.wrapper {
+  display: grid;
+  grid-template-columns: repeat(3, 1fr);
+  grid-gap: 10px;
+  grid-auto-rows: minmax(100px, auto);
+}
+.one {
+  grid-column: 1 / 3;
+  grid-row: 1;
+}
+.two {
+  grid-column: 2 / 4;
+  grid-row: 1 / 3;
+}
+.three {
+  grid-column: 1;
+  grid-row: 2 / 5;
+}
+.four {
+  grid-column: 3;
+  grid-row: 3;
+}
+.five {
+  grid-column: 2;
+  grid-row: 4;
+}
+.six {
+  grid-column: 3;
+  grid-row: 4;
+}
+
+ +

{{ EmbedLiveSample('example', '500', '440') }}

+
+ +

Referencia

+ +

CSS tulajdonságok

+ +
+ +
+ +

CSS funkciók

+ +
+ +
+ +

CSS adattípusok

+ +
+ +
+ +

Szójegyzék

+ +
+ +
+ +

Segédletek

+ +
+ +
+ +

Külső források

+ + + +

Specifikációk

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName("CSS Grid 2") }}{{ Spec2("CSS Grid 2") }}Added subgrids.
{{ SpecName('CSS3 Grid') }}{{ Spec2('CSS3 Grid') }}Initial definition.
+ + diff --git a/files/hu/css/font-weight/index.html b/files/hu/css/font-weight/index.html new file mode 100644 index 0000000000..6e27ac6341 --- /dev/null +++ b/files/hu/css/font-weight/index.html @@ -0,0 +1,400 @@ +--- +title: Betű vastagság +slug: CSS/font-weight +translation_of: Web/CSS/font-weight +--- +
{{CSSRef}}
+ +

A betűvastagság (font-weight) CSS tulajdonság beállítja a betűtípus nyomatékosságát, vastagságát (angolul "weight" vagy "boldness"). Az elérhető betűvastagság méretek a beállított betűtípustól ({{cssxref("font-family")}}) függenek.

+ +
{{EmbedInteractiveExample("pages/css/font-weight.html")}}
+ + + +

Szintaxis

+ +
/* Kulcsszavas értékek */
+font-weight: normal; // normál vastagság
+font-weight: bold; // félkövér
+
+/* Kulcsszavas értékek a szülő elemhez viszonyítva */
+font-weight: lighter;
+font-weight: bolder;
+
+/* Numerikus értékek */
+font-weight: 100;
+font-weight: 200;
+font-weight: 300;
+font-weight: 400; // normál
+font-weight: 500;
+font-weight: 600;
+font-weight: 700; // félkövér
+font-weight: 800;
+font-weight: 900;
+
+/* Globális értékek */
+font-weight: inherit;
+font-weight: initial;
+font-weight: unset;
+
+ +

A betűvastagság (font-weight) tulajdonság bármely fentebb bemutatott módon beállítható.

+ +

Értékek

+ +
+
normal
+
Normál betűvastagság. Megegyezik a 400-as értékkel.
+
bold
+
Félkövér. Megegyezik a 700-as értékkel.
+
lighter
+
Relatív betűvastagság, a szülő elem formázásához viszonyít, annál vékonyabb betűvastagságot állít be. Megjegyzés: csupán négy betűvastagságot tartunk számon, melyek relatív értékek. (Bővebben: {{anch("Relatív betűvastagság jelentése")}} bekezdés lentebb.)
+
bolder
+
Relatív betűvastagság, a szülő elem formázásához viszonyít, annál vastagabb betűvastagságot állít be. Megjegyzés: csupán négy betűvastagságot tartunk számon, melyek relatív értékek. (Bővebben: {{anch("Relatív betűvastagság jelentése")}} bekezdés lentebb.)
+
<number>
+
A {{cssxref("<number>")}} (szám) érték 1 és 1000 között megadható (az 1000 is beletartozik az intervallumba). Minél magasabb az érték, annál vastagabb lesz a betű formázás. Néhány gyakran használt érték megfeleltethető betűvastagság elnevezéseknek, bővebben lásd az Általános betűvastagság elnevezések bekezdésnél.
+
+ +

A betűvastagság beállítás régebbi verzióiban ez a tulajdonság csak kulcsszavakas értékeket és számokat fogad el (100, 200, 300, 400, 500, 600, 700, 800, és 900). A nem változó betűtípusok csak ezeket az értékeket tudják értelmezni. (Változó betűtípus: egyetlen betűkészlet-fájl, amely több stílusként viselkedik. Bővebben itt tudsz utánaolvasni.) A "finomszemcsés" értékek (pl: 451) a nem változó betűtípusok esetében lefordítódnak a fentebb említett értékek egyikére a {{anch("Fallback weights")}} rendszer segítségével.

+ +

A CSS Fonts Level 4 kiterjeszti a szintaxist, és bármely számot el tudja fogadni 1 és 1000 között, illetve bevezeti a Változó betűtípus készleteket ({{anch("Variable fonts")}}), amelyek már tudják használni ezeket a "finomszemcsés" betűvastagság értékeket is.

+ +

Alapeset

+ +

Hogyha a megadott betűvastagság nem elérhető adott betűtípuson, az alábbi szabály lép életbe, mely eldönti a véglegesen megjelenítendő betűvastagságot:

+ + + +

Relatív betűvastagság jelentése

+ +

Amikor lighter vagy bolder betűvastagságot határozunk meg, az alábbi táblázat segít megérteni, hogyan dől el, mi lesz a betűvastagságunk abszolút értéke.

+ +

Megjegyzés: csupán 4 értéket tartunk számon relatív értékként: vékony, keskeny (thin, 100), normál (normal, 400), félkövér (bold, 700), és vastag (heavy, 900). Ha egy betűtípus család ennél több elérhető értékkel rendelkezik, azok ebben az esetben mellőzve lesznek annak érdekében, hogy a relatív értéket át tudjuk alakítani abszolút értékké.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Örökölt értékbolderlighter
100400100
200400100
300400100
400700100
500700100
600900400
700900400
800900700
900900700
+ +

Általános betűvastagság elnevezések

+ +

A numerikus értékek 100-tól 900-ig megfeleltethetők az alábbi általános betűvastagság elnevezéseknek. (Bővebben: OpenType specification):

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ÉrtékÁltalános betűvastagság elnevezés
100Thin (Hairline)
200Extra Light (Ultra Light)
300Light
400Normal (Regular)
500Medium
600Semi Bold (Demi Bold)
700Bold
800Extra Bold (Ultra Bold)
900Black (Heavy)
950Extra Black (Ultra Black)
+ +

Változó betűtípus útmutató

+ +

A legtöbb betűtípusnak van egy bizonyos betűvastagsága, ami a fentebbi Általános betűvastagság elnevezések értékeinek megfeleltethető. Azonban néhány betűtípus, amit változó betűtípusnak nevezünk, ezeknél sokkal pontosabb, aprószemcsés értéket is meg tud jeleníteni, és ez sokkal nagyobb kontrollt adhat egy designernek.

+ +

A TrueType vagy OpenType változó betűtípusok a "wght" variációjukkal tudnak implementálni változó szélességet.

+ +

Az alábbi példához egy olyan böngészőre lesz szükséged, ami támogatja a CSS Fonts Level 4 szintaxist, amellyel bármilyen értéket meg tudunk adni 1 és 1000 között.

+ +
{{EmbedLiveSample("variable-font-example", 1200, 180, "", "", "example-outcome-frame")}}
+ +

HTML

+ +
+
<header>
+    <input type="range" id="weight" name="weight" min="1" max="1000" />
+    <label for="weight">Weight</label>
+</header>
+<div class="container">
+    <p class="sample">...it would not be wonderful to meet a Megalosaurus, forty feet long or so, waddling like an elephantine lizard up Holborn Hill.</p>
+</div>
+
+ +

CSS

+ +
/*
+Mutator Sans is created by LettError (https://github.com/LettError/mutatorSans)
+and is used here under the terms of its license:
+https://github.com/LettError/mutatorSans/blob/master/LICENSE
+*/
+
+@font-face {
+  src: url('https://mdn.mozillademos.org/files/16011/MutatorSans.ttf');
+  font-family:'MutatorSans';
+  font-style: normal;
+}
+
+label {
+  font: 1rem monospace;
+  white-space: nowrap;
+}
+
+.container {
+  max-height: 150px;
+  overflow-y: auto;
+}
+
+.sample {
+  text-transform: uppercase;
+  font: 1.5rem 'MutatorSans', sans-serif;
+}
+
+ + + +

JavaScript

+ +
let weightLabel = document.querySelector('label[for="weight"]');
+let weightInput = document.querySelector('#weight');
+let sampleText = document.querySelector('.sample');
+
+function update() {
+  weightLabel.textContent = `font-weight: ${weightInput.value};`;
+  sampleText.style.fontWeight = weightInput.value;
+}
+
+weightInput.addEventListener('input', update);
+
+update();
+
+
+ +

Accessibility concerns

+ +

Látási nehézségekkel küzdő emberek számára nehézséget okozhat a 100-as (Thin/Hairline) és 200-as (Extra Light) betűvastagsággal írt szövegek elolvasása, különösképpen ha alacsony a színkontraszt

+ + + +

Formal definition

+ +

{{cssinfo}}

+ +

Formal syntax

+ +
{{csssyntax}}
+ +

Példák

+ +

Betűvastagság beállítása

+ +

HTML

+ +
<p>
+  Alice was beginning to get very tired of sitting by her sister on the
+  bank, and of having nothing to do: once or twice she had peeped into the
+  book her sister was reading, but it had no pictures or conversations in
+  it, "and what is the use of a book," thought Alice "without pictures or
+  conversations?"
+</p>
+
+<div>I'm heavy<br/>
+  <span>I'm lighter</span>
+</div>
+
+ +

CSS

+ +
/* Set paragraph text to be bold. */
+p {
+  font-weight: bold;
+}
+
+/* Set div text to two steps heavier than
+   normal but less than a standard bold. */
+div {
+ font-weight: 600;
+}
+
+/* Set span text to be one step lighter
+   than its parent. */
+span {
+  font-weight: lighter;
+}
+ +

Result

+ +

{{EmbedLiveSample("Betűvastagság_beállítása","400","300")}}

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS4 Fonts', '#font-weight-prop', 'font-weight')}}{{Spec2('CSS4 Fonts')}}Defines font-weight to accept any numbers between 1 and 1000.
{{SpecName('CSS3 Fonts', '#font-weight-prop', 'font-weight')}}{{Spec2('CSS3 Fonts')}}No change.
{{SpecName('CSS2.1', 'fonts.html#propdef-font-weight', 'font-weight')}}{{Spec2('CSS2.1')}}No change.
{{SpecName('CSS1', '#font-weight', 'font-weight')}}{{Spec2('CSS1')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("css.properties.font-weight")}}

diff --git a/files/hu/css/index.html b/files/hu/css/index.html new file mode 100644 index 0000000000..6717bc7093 --- /dev/null +++ b/files/hu/css/index.html @@ -0,0 +1,92 @@ +--- +title: CSS +slug: CSS +tags: + - CSS + - Design + - Dizájn + - Stíluslapok + - Stílusok +translation_of: Web/CSS +--- +
+

A Cascading Style Sheets (CSS) egy stíluslap nyelv, mellyel a HTML-ben vagy XML-ben (és más XML nyelveken, mint az XHTML vagy a SVG) írt dokumentumok megjelenítését lehet leírni.

+ +

A CSS a nyílt web egyik fő nyelve, amely a W3C specifikációnak megfelelően szabványosítva van a webböngészőkben. Szintenként van fejlesztve, a CSS1 ma már elavult, a CSS2.1 használata az ajánlott, a CSS3 pedig már kisebb modulokra lett osztva, jelenleg is a szabványosítása zajlik.

+ + +
+ + + + + + + + +
+

CSS Dokumentáció

+ +
+
Bevezetés a CSS-be
+
Ez az oldal alapvető információkat nyújt arról, hogyan működik a CSS, azaz bemutatja a szelektorokat és a tulajdonságokat, a CSS szabályok írását, a CSS alkalmazását a HTML-re, a dobozmodell alapjait, valamint a CSS hibakeresést.
+
CSS Referencia
+
A teljeskörű CSS referencia a tapasztalt webes fejlesztők számára a CSS minden tulajdonságát és fogalmát írja le.
+
+ +
+
URL-értékek használata a kurzor tulajdonsághoz 
+
Gecko 1.8 (Firefox 1.5, SeaMonkey 1.0) támogatja a CSS 2/2.1 kurzor tulajdonság URL-értékeit. Ez lehetővé teszi tetszőleges képek egér kurzorokként való használatát - bármely Gecko által támogatott képformátum használható.
+
+ +
+
CSS3 Oszlopok
+
Rövid bemutató a CSS3 oszlopok használatáról.
+
+ +
+
Konzisztens listajelzés
+
A listák behúzásának megkísérlése a CSS-sel trükkösebb, mint amilyennek látszik, de csak azért, mert a CSS-kompatibilis böngészőknek különböznek az alapértelmezései. Ismerd meg, hogyan lehet őket egy vonalba hozni.
+
+ +

Összes megtekintése...

+
+

Segítségkérés a közösségtől

+ +

CSS-el kapcsolatos segítségre van szükséged és nem találod a megoldást a dokumentációban?

+ + + +

Eszközök a CSS fejlesztéshez

+ + + +

Összes megtekintése...

+
+ +

Kapcsolódó témakörök

+ + diff --git a/files/hu/css/text-decoration/index.html b/files/hu/css/text-decoration/index.html new file mode 100644 index 0000000000..22de3ad153 --- /dev/null +++ b/files/hu/css/text-decoration/index.html @@ -0,0 +1,150 @@ +--- +title: Szöveg díszítés +slug: CSS/text-decoration +tags: + - CSS tulajdonság + - szöveg díszítés +translation_of: Web/CSS/text-decoration +--- +
{{CSSRef}}
+ +

A szöveg díszítés (text-decoration) rövidített CSS tulajdonság a szöveget díszítő vonalakat állítja be. Ez a tulajdonság egy rövidítés, amely az alábbi tulajdonságokat foglalja magába: {{cssxref("text-decoration-line")}} (szöveg díszítő vonal), {{cssxref("text-decoration-color")}} (-szín), {{cssxref("text-decoration-style")}} (-stílus), és az újabb {{cssxref("text-decoration-thickness")}} (-vastagság).

+ +
{{EmbedInteractiveExample("pages/css/text-decoration.html")}}
+ + + +

A szöveg díszítések leszármazott szövegelemekre is érvényesek lesznek. Ez annyit jelent, hogyha egy elemen specifikálunk valamilyen szöveg díszítést, akkor a leszármazott elem nem tudja majd eltávolítani ezt a díszítést. Vegyük például ezt a jelölő nyelvi elemet: <p>Ez a szöveg néhány <em>hangsúlyos, kiemelt szót</em> is tartalmaz.</p>, és ezt a stílus szabályt: p { text-decoration: underline; }. Ez esetben a teljes paragrafusra érvényes lenne az aláhúzás. Az em { text-decoration: none; } stílus szabály nem hozna változást, a teljes bekezdés megmaradna aláhúzottan. Azonban az  em { text-decoration: overline; } egy második szöveg díszítést is bevezetne, és egy felső vonal is megjelenne a kiemelt szavakon ("hangsúlyos, kiemelt szót" szavakon).

+ +

A szabályban foglalt tulajdonságok

+ +

A text-decoration tulajdonság egy rövidítés, mely magába foglalja az alábbi CSS tulajdonságokat: szín, vonal, stílus, vastagság.

+ + + +

Szintaxis

+ +

A text-decoration tulajdonságot egy vagy több érték megadásával is létrehozhatjuk, melyeket szóközzel kell elválasztanunk. Ezek az értékek fogják képviselni a fentebb is említett tulajdonságokat, melyeket a text-decoration magába foglal.

+ +

Értékek

+ +
+
{{cssxref("text-decoration-line")}}
+
Beállítja a díszítő vonal elhelyezését: a szöveg alá, fölé, vagy rá (áthúzás) is kerülhet. (underline, overline vagy line-through).
+
{{cssxref("text-decoration-color")}}
+
Beállítja a díszítő vonal színét.
+
{{cssxref("text-decoration-style")}}
+
Beállítja a díszítő vonal stílusát, például egyszerű vonal, hullámos, vagy szaggatott ( solid, wavy, or dashed).
+
{{cssxref("text-decoration-thickness")}}
+
Beállítja a díszítő vonal vastagságát.
+
+ +

Régebbi meghatározás

+ +

{{CSSInfo}}

+ +

Régebbi szintaxis

+ +
{{csssyntax}}
+ +

Példák

+ +

Szöveg díszítés bemutatása

+ +
.under {
+  text-decoration: underline red;
+}
+
+.over {
+  text-decoration: wavy overline lime;
+}
+
+.line {
+  text-decoration: line-through;
+}
+
+.plain {
+  text-decoration: none;
+}
+
+.underover {
+  text-decoration: dashed underline overline;
+}
+
+.thick {
+  text-decoration: solid underline purple 4px;
+}
+
+.blink {
+  text-decoration: blink;
+}
+
+ +
<p class="under">Ezen szöveg alatt látható egy vonal.</p>
+<p class="over">Ezen szöveg fölött látható egy vonal.</p>
+<p class="line">Ez a szöveg át van húzva.</p>
+<p>Ez a <a class="plain" href="#">link nincs aláhúzva</a>,
+    mint ahogyan a linkeknél alapvetően látni szoktuk.
+Óvatosan használjuk ezt a formázást a linkeken, hiszen a
+felhasználók sokszor erre az alap formázásra támaszkodnak,
+ha linkeket keresnek a szövegben.</p>
+<p class="underover">Ezen szöveg fölött <em>és</em> alatt is van vonal.</p>
+<p class="thick">Ezen szöveg alatt látható egy vastag lila
+aláhúzás azon böngészőkben, melyek támogatják ezt a formázást.</p>
+<p class="blink">Ez a szöveg villog, ha olyan böngészőt
+használsz, ami támogatja ezt a formázást.</p>
+
+ +

{{EmbedLiveSample('Példák','auto','320')}}

+ +

Specifikációk

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecifikációStátuszKomment
{{SpecName('CSS4 Text Decoration')}}{{Spec2('CSS4 Text Decoration')}}A {{cssxref("text-decoration-thickness")}}; tulajdonság hozzáadva. Megjegyzés: ez még hivatalosan nem része a rövidített stílus szabálynak - ez még nincs meghatározva.
{{SpecName('CSS3 Text Decoration', '#text-decoration-property', 'text-decoration')}}{{Spec2('CSS3 Text Decoration')}}Átalakítva rövidített tulajdonsággá. A {{cssxref('text-decoration-style')}} érték támogatása hozzáadva.
{{SpecName('CSS2.1', 'text.html#lining-striking-props', 'text-decoration')}}{{Spec2('CSS2.1')}}Nincs szignifikáns változtatás.
{{SpecName('CSS1', '#text-decoration', 'text-decoration')}}{{Spec2('CSS1')}}Kezdeti definiálás.
+ +

Böngésző kompatibilitás

+ + + +

{{Compat("css.properties.text-decoration")}}

+ +

Lásd még

+ + diff --git a/files/hu/dom/htmlbrelement/index.html b/files/hu/dom/htmlbrelement/index.html new file mode 100644 index 0000000000..8842c0a233 --- /dev/null +++ b/files/hu/dom/htmlbrelement/index.html @@ -0,0 +1,32 @@ +--- +title: HTMLBRElement +slug: DOM/HTMLBRElement +translation_of: Web/API/HTMLBRElement +--- +
+ {{ ApiRef() }}
+

HTML törés elem felület

+

A DOM törés elemek a HTMLBRElement (vagy HTML 4 HTMLBRElement) felületet fejtik ki, amelyek a HTMLElementből öröklődnek, de nem határoz meg további tagokat a {{ HTMLVersionInline(5) }} verzióban. A bevezetett további tulajdonság szintén elavult a {{ HTMLVersionInline(4.01) }} verzióban.

+

Tulajdonságok

+ + + + + + + + + + + + + + + +
NévTípusLeírás
clear {{ HTMLVersionInline(4.01) }}, {{ obsolete_inline() }} a {{ HTMLVersionInline(5) }} ótaDOMStringA szöveg körbefuttatását jelzi a lebegő objektumok körül.
+

Lásd még

+ +
+ {{ languages({ "en": "en/DOM/HTMLBRElement", "hu": "hu/DOM/HTMLBRElement", "ja": "ja/DOM/HTMLBRElement" }) }}
diff --git a/files/hu/dom/index.html b/files/hu/dom/index.html new file mode 100644 index 0000000000..a87a730a58 --- /dev/null +++ b/files/hu/dom/index.html @@ -0,0 +1,74 @@ +--- +title: DOM +slug: DOM +tags: + - DOM + - minden_kategória +translation_of: Web/API/Document_Object_Model +--- +
+

A dokumentumobjektum-modell (DOM) egy API a HTML és az XML documentumokhoz.The Document Object Model (DOM) is an API for HTML and XML documents. A dokumentum szerkezetét modellezi és lehetővé teszi annak tartalmi és vizulális változtatását.It provides a structural representation of the document, enabling you to modify its content and visual presentation. Lényegében összeköttetést képez a weblapok és a script- vagy programozási nyelvek között. Essentially, it connects web pages to scripts or programming languages.

+
+ + + + + + + +
+

Dokumetáció

+
+
+ Gecko DOM referencia
+
+ Gecko dokumentumobjektum-modell referencia.
+
+
+
+ Bevezetés a dokumentumobjektum-modellbe
+
+ Rövid bevezetés a DOM-ba.
+
+
+
+ Az XUL-alapú felhasználói felület dinamikus változtatása
+
+ Alapvető ismeretek a XUL felhasználói felület DOM módszerekkel való változtatásáról.
+
+
+
+ A DOM és a JavaScript
+
+ Mi a DOM? Mi a JavaScript? Hogyan tudom együtt használni őket a weboldalamon? Itt ehhez hasonló kérdésekre kaphatsz választ.
+
+
+
+ A dokumentumobjektum-modell a Mozilla böngészőben
+
+ Egy korábbi DOM leírás a mozilla.org site-on.
+
+

Továbbá...

+
+

Közösség

+
    +
  • Lásd a Mozilla fórumait...
  • +
+

{{ DiscussionList("dev-tech-dom", "mozilla.dev.tech.dom") }}

+

Eszközök

+ +

További eszközök...

+

Kapcsolódó témák

+
+
+ AJAX, CSS, DHTML, JavaScript
+
+
+

Categories

+

Interwiki Language Links

+

{{ languages( { "en": "en/DOM", "zh-cn": "cn/DOM", "de": "de/DOM", "es": "es/DOM", "fr": "fr/DOM", "ko": "ko/DOM", "ja": "ja/DOM", "nl": "nl/DOM", "pl": "pl/DOM", "pt": "pt/DOM", "ru": "ru/DOM" } ) }}

diff --git a/files/hu/glossary/abstraction/index.html b/files/hu/glossary/abstraction/index.html new file mode 100644 index 0000000000..bf5dc1b36e --- /dev/null +++ b/files/hu/glossary/abstraction/index.html @@ -0,0 +1,49 @@ +--- +title: Absztrakció +slug: Glossary/Abstraction +tags: + - Absztrakció + - Kódolás + - Programozási Nyelv + - Szójegyzék +translation_of: Glossary/Abstraction +--- +

A {{Glossary("computer programming", "számítógépes programozás")}}ban az absztrakció lehetővé teszi a komplex szoftveres rendszerek bonyolultságának csökkentését illetve a hatékony dizájnt és kivitelezést. A bonyolult technikai rendszereket egyszerűbb {{Glossary("API", "API")}}-ok mögé rejti.

+ +

Az adatabsztrakció előnyei

+ + + +

Példa

+ +
class AbsztrakcioBevezetes {
+  // a belső tagok értékének megváltoztatása
+  beallit(x, y) {
+    this.a = x;
+    this.b = y;
+  }
+
+  kiiras() {
+    console.log('a = ' + this.a);
+    console.log('b = ' + this.b);
+  }
+}
+
+const obj = new AbsztrakcioBevezetes();
+obj.beallit(10, 20);
+obj.kiiras();
+// a = 10
+// b = 20
+ +

Tudjon meg többet

+ +

Általános ismeretek

+ + diff --git a/files/hu/glossary/ajax/index.html b/files/hu/glossary/ajax/index.html new file mode 100644 index 0000000000..e7f8a4b6e2 --- /dev/null +++ b/files/hu/glossary/ajax/index.html @@ -0,0 +1,31 @@ +--- +title: Ajax +slug: Glossary/AJAX +tags: + - AJAX + - Infrastruktúra + - Szójegyzék +translation_of: Glossary/AJAX +--- +

Az Ajax (Asynchronous {{Glossary("JavaScript")}} And {{Glossary("XML")}}), egy programozási gyakorlat komplex és dinamikus weblapok építésére egy {{Glossary("XHR_(XMLHttpRequest)","XMLHttpRequest")}} nevezetű technológiát használva.

+ +

Az Ajax lehetővé teszi a {{Glossary("DOM")}} egy részének a frissítését egy {{Glossary("HTML")}} oldalon, teljes oldalfrissítés szükségessége nélkül. Az Ajax lehetővé teszi az aszinkronos munkát, ami azt jelenti, hogy amíg az oldal célzott része megpróbál újratölteni, addig az oldal többi része tovább fut (ezzel ellentétben a szinkronos módszer blokkolja a kód további futását, amíg az oldal célzott része újra nem töltött).

+ +

Az interaktív weboldalakkal és modern internetes szabványokkal, az Ajax-ot szépen lassan felváltják a JavaScript keretrendszereken belüli függvények és az eredeti {{domxref("Fetch API")}} Szabvány.

+ + diff --git a/files/hu/glossary/api/index.html b/files/hu/glossary/api/index.html new file mode 100644 index 0000000000..a3102d330e --- /dev/null +++ b/files/hu/glossary/api/index.html @@ -0,0 +1,40 @@ +--- +title: API +slug: Glossary/API +tags: + - Glossary +translation_of: Glossary/API +--- +

Az API a programozás során előforduló egyik leggyakoribb és legijesztőbb kifejezés. Ennek ellenére nem annyira rettenetes: például ennek a szócikknek az elolvasásával meg is lehet érteni.

+ +

Az API szó az angol Application Programming Interface rövidítése. Egy olyan felületet jelöl, amin keresztül egy külső programot el lehet érni, kommunikálni lehet vele. (Tehát a külső program képességeit más programokból hasznosítani lehet).

+ +

Fontos, hogy az API számítógépek számára készül: programból könnyen összeállítható a bemenete és feldolgozható a kimenete, de emberek számára nehezebben értelmezhető.

+ +

Webfejlesztés során általában kétféle API-val találkozhatunk:

+ + + +

Példák

+ + + +

További olvasnivaló

+ +

Általános tudás

+ + + +

Technikai részletek

+ + diff --git a/files/hu/glossary/bongeszo/index.html b/files/hu/glossary/bongeszo/index.html new file mode 100644 index 0000000000..36a13cf1ce --- /dev/null +++ b/files/hu/glossary/bongeszo/index.html @@ -0,0 +1,37 @@ +--- +title: Böngésző +slug: Glossary/bongeszo +tags: + - Nacigáció + - Szójegyzék +translation_of: Glossary/Browser +--- +

A Webböngésző vagy böngésző egy program, ami a {{Glossary("World Wide Web","webből")}} kinyeri és megjeleníti az oldalakat és lehetővé teszi a felhasználó számára a további oldalakhoz való hozzáférést {{Glossary("hyperlink","hivatkozásokon")}} keresztül. A böngésző a legismertebb {{Glossary("user agent", "hálózati kliens")}}.

+ +

Tudj meg többet

+ +

Egy böngésző letöltése

+ + + + diff --git a/files/hu/glossary/callback_function/index.html b/files/hu/glossary/callback_function/index.html new file mode 100644 index 0000000000..36ae03f558 --- /dev/null +++ b/files/hu/glossary/callback_function/index.html @@ -0,0 +1,31 @@ +--- +title: Callback függvény +slug: Glossary/Callback_function +translation_of: Glossary/Callback_function +--- +

A callback függvény (vagy visszahívó függvény) egy függvény, amit egy másik függvénynek adunk át argumentumként, ami aztán majd a külső függvényen belül hívódik meg, hogy végrehajtson egy adott eseményt.

+ +

Íme egy példa:

+ +
function üdvözlés(név) {
+  alert('Hello ' + név);
+}
+
+function felhasználóInputFeldolgozása(callback) {
+  const név = prompt('Kérlek add meg a neved!');
+  callback(név);
+}
+
+felhasználóInputFeldolgozása(üdvözlés);
+ +

A fenti példa egy {{glossary("synchronous")}} (szinkron) callback, mivel azonnal végrehajtódik.

+ +

Megjegyzés: a callback függvények gyakran használatosak arra a célra, hogy folytassák a kód végrehajtását, miután egy {{glossary("asynchronous")}} (aszinkron) művelet végrehajtása befejeződött. Ezeket aszinkron callback-nek nevezzük. Egy jó példa erre a  .then() blokkon belül végrehajtott függvények, miután az adott ígéret (promise) teljesül (fulfill), vagy el lesz utasítva (reject). Ezt a felépítést sok modern web API használja, például a fetch() is.

+ +

Tudj meg többet

+ +

Általános tudás

+ + diff --git a/files/hu/glossary/css/index.html b/files/hu/glossary/css/index.html new file mode 100644 index 0000000000..1a4a5ff97f --- /dev/null +++ b/files/hu/glossary/css/index.html @@ -0,0 +1,41 @@ +--- +title: CSS +slug: Glossary/CSS +tags: + - CSS + - Szójegyzék + - Web +translation_of: Glossary/CSS +--- +

A CSS (Cascading Style Sheets) egy deklaratív nyelv, ami a weblapok kinézetét irányítja a {{glossary("browser", "böngésző")}}ben. A böngésző hozzáilleszti a megfelelő CSS stílusdeklarációt a kiválaszott elemekre, hogy rendesen meg tudja jeleníteni azokat. Egy stílus deklaráció tulajdonságokat és értékeket tartalmaz, amik meghatározzák hogyan fog kinézni egy weboldal.

+ +

A CSS a három leglényegesebb Web technológia egyike, úgy mint a {{Glossary("HTML")}} és {{Glossary("JavaScript")}}. A CSS általában {{Glossary("Element","HTML elemeket")}} díszít, de más jelölőnyelvekkel is lehet használni, mint például az {{Glossary("SVG")}} vagy az {{Glossary("XML")}}.

+ +

Egy CSS szabály {{Glossary("CSS Property","tulajdonságok")}} összessége, amiket egy {{Glossary("CSS selector", "szelektorhoz")}} lehet társítani. Itt egy példa, ami minden HTML bekezdést sárgává fest fekete hátérrel:

+ +
/* A "p" szelektor azt jelzi, hogy a dokumentum minden bekezdését érinteni fogja a szabály
+p {
+  /* A "color" tulajdonság határozza meg a szöveg színét, ebben az esetben sárga */
+  color: yellow;
+
+  /* A "background-color" tulajdonság a háttérszínt határozza meg, ebben az esetben fekete */
+  background-color: black
+}
+ +

A "lépcsőzetesség" arra a szabályra vontakozik, ami meghatározza a szelektorok prioritási sorrendjét. Ez egy nagyon fontos tulajdonság, mivel egy bonyolultabb webodalon több ezernyi CSS szabály is lehet.

+ +

Tudjon meg többet

+ +

Általános tudnivalók

+ + + +

Technikai referenciák

+ + diff --git a/files/hu/glossary/elso_osztalyu_funkciok/index.html b/files/hu/glossary/elso_osztalyu_funkciok/index.html new file mode 100644 index 0000000000..5a36982129 --- /dev/null +++ b/files/hu/glossary/elso_osztalyu_funkciok/index.html @@ -0,0 +1,103 @@ +--- +title: Elsőrendű függvények +slug: Glossary/Elso_osztalyu_funkciok +tags: + - JavaScript + - Szkriptelés + - Szójegyzék +translation_of: Glossary/First-class_Function +--- +

Egy programnyelvnek Elsőrendű függvényei vannak, ha a nyelv függvényeit úgy kezeljük mint a többi változót. Egy ilyen nyelveben függvényeket adhatunk meg más függvények paramátereként, függvények más függvényeket adhatnak vissza és váltózókhoz is hozzárendelhetjük őket.

+ +

Példa | Függvény hozzárendelése változóhoz

+ +

JavaScript

+ +
const foo = function() {
+   console.log("foobar");
+}
+// Meghívás a változóra való hivatkozással
+foo();
+
+ +

Egy Névtelen függvényt rendeltünk egy Váltózóhoz, ezután a változó segítségével meghívtuk a függvényt úgy, hogy zárójelet tettünk () a változónév végére.

+ +
+

Ha a függvény el is lenne nevezve, akkor is használhatnánk a változót a meghívására. Az elnevezés segítségünkre lehet a hibakeresésé során, de nem érinti a függvény meghívási módját.

+
+ +

Példa | Függvény átadása argumentumként

+ +

JavaScript

+ +
function koszones() {
+   return "Helló, ";
+}
+function udvozlet(koszont, nev) {
+  console.log(koszont() + nev);
+}
+// `koszones` átadása argumentumként az `udvozlet` függénynek
+udvozlet(koszones, "JavaScript!");
+
+ +

A koszones() függvényt adjuk át az udvozlet() függvény argumentumaként, ami magyarázatot ad arra, hogy hogyan tudjuk a függényeket értékként kezelni.

+ +
+

A függvényt, aminek egy másik függvényt adunk át argumentumként, Visszahívó Függvénynek nevezzük. koszones egy visszahívó függvény.

+
+ +

Példa | Függvény visszatérítése

+ +

JavaScript

+ +
function koszones() {
+   return function() {
+      console.log("Helló!");
+   }
+}
+
+ +

Ebben a példában egy függvényt kell visszatérítenünk egy másik függvényből - Azért tudjuk ezt megtenni, mert a JavaScript a függvényeket értékként kezeli.

+ +
+

Azt a függvényt, amely egy másik függnény térít vissza,  Felsőbbrendű Függvénynek nevezzük.

+
+ +

Visszatérve a példánkra; most a koszones függvényt kell meghívnunk, amit Névtelen Függvényként kaptunk vissza. Ez kétféle módon lehetséges:

+ +

1- Változó használata

+ +
const koszones = function() {
+   return function() {
+      console.log("Helló!");
+   }
+}
+const fuggvenyem = koszones();
+fuggvenyem();
+
+ +

Így megkapjuk a Helló! üzenetet.

+ +
+

Változót kell használnunk. Ha koszonest közvetlenül hívtuk volna meg, a függvényt adta volna vissza anélkül, hogy meghívta volna a visszatérített függvényt.

+
+ +

2- Dupla zárójel használata

+ +
function koszones() {
+   return function() {
+      console.log("Helló!");
+   }
+}
+koszones()();
+
+ +

Dupla zárojelet ()() használunk, hogy meghívjuk a visszatérített függvényt.

+ +

Tudjon meg többet

+ +

Általános Ismeretek

+ + diff --git a/files/hu/glossary/index.html b/files/hu/glossary/index.html new file mode 100644 index 0000000000..3bb931c888 --- /dev/null +++ b/files/hu/glossary/index.html @@ -0,0 +1,27 @@ +--- +title: Szójegyzék +slug: Glossary +tags: + - Beginner + - Glossary + - Index + - Landing + - NeedsTranslation + - TopicStub +translation_of: Glossary +--- +
{{LearnBox({"title":"Learn a new term:"})}}
+ +

A Webes technológiák zsargonok és rövidítések hosszú listáját használják dokumentációikban és a fejlesztésük során. Ez a szójegyzék azon szavak és rövidítések definícióját tartalmazza, amelyek ismeretére szükség lehet ahhoz, hogy ön meg tudja érteni és fejleszteni tudja a webet.

+ +

{{GlossaryList({"split":"h3", "css":"multiColumnList"})}}

+ +

Közreműködés a szójegyzékben

+ +

Ez a szójegyzék egy örökösen folyamatban lévő munka. Segíthet a fejlesztésében új bejegyzések hozzáadásaával vagy a már meglévők javításával. Úgy kezdhet bele a legkönnyebben, ha rákattint az alábbi linkre vagy kiválasztja valamelyik ajánlott kifejezést lentebb.

+ +

Új bejegyzés hozzáadása a szójegyzékhez

+ +

{{GlossaryList({"terms":[], "filter":"notdefined", "css":"multiColumnList"})}}

+ +

Ha többet szeretne megtudni arról, hogyan tud közreműködni a szójegyzékben, látogassa meg a szójegyzék dokumentációjának oldalát.

diff --git a/files/hu/glossary/javascript/index.html b/files/hu/glossary/javascript/index.html new file mode 100644 index 0000000000..ab5af7cb3f --- /dev/null +++ b/files/hu/glossary/javascript/index.html @@ -0,0 +1,45 @@ +--- +title: JavaScript +slug: Glossary/JavaScript +tags: + - JavaScript +translation_of: Glossary/JavaScript +--- +

A JavaScript (vagy „JS”) egy programozási nyelv, amelyet leggyakrabban dinamikus, kliensoldali szkriptekhez használnak weblapokon, de gyakran használják {{Glossary("Server","kiszolgáló")}}oldalon is, például a Node.js futtatókörnyezetben.

+ +

A JavaScript nem összetévesztendő a Java programozási nyelvvel. Bár a „Java” és a „JavaScript” is az Oracle USA-ban és sok más országban bejegyzett védjegye, a két programozási nyelv szintaktikája, szematikája és alkalmazási köre jelentős mértékben eltér.

+ +

A JavaScriptet elsődlegesn böngészőben használják, és lehetővé teszi, hogy a fejlesztők módosítsák a weboldal tartalmát a {{Glossary("DOM")}}-on keresztül, adatokat kezeljenek {{Glossary("AJAX")}} és {{Glossary("IndexedDB")}} segítségével, grafikákat rajzoljanak a {{Glossary("canvas")}} használatával, különböző {{Glossary("API","API-kkal")}} interakcióba lépjenek a böngészőt futtató eszközzel, és ez még nem minden. A JavaScript egyike a világ leggyakrabban használt nyelveinek, köszönhetően a böngészőkben elérhető {{Glossary("API","API-k")}} jelentős terjedésének és teljesítménybeli fejlesztéseinek.

+ +

Eredet és történelem

+ +

Eredetileg kiszolgálóoldali nyelvként találta ki Brendan Eich (akkor a Netscape Corporation munkatársa), aztán a JavaScript megérkezett a Netscape Navigator 2.0-ban, 1995 szeptemberében. A JavaScript azonnali sikernek örvendett, és 1996 augusztusában az {{glossary("Microsoft Internet Explorer", "Internet Explorer 3.0")}} bevezette a JavaScript támogatását, JScript néven.

+ +

1996 novemberében a Netscape elkezdett az ECMA International szabványügyi szervezettel azon dolgozni, ohgy iparági szabvánnyá tegyék a JavaScriptet. Azóta a szabványosított JavaScript neve ECMAScript, és az ECMA-262 alatt specifikált, és amely legfrissebb (tizedik, ES2019) kiadása 2019 júniusa óta érhető el.

+ +

Nemrégiben a JavaScript népszerűsége még tovább nőtt a Node.js platform sikere miatt – eza legnépszerűbb keresztplatformos JavaScript futtatókörnyezet a böngészőkön kívül. A Node.js – a Chrome V8 JavaScript-motorjára építve – lehetővé teszi a fejlesztőknek, hogy a fejlesztők JavaScripttel programozzák a számítógépet, és teljes funkcionalitással rendelkező {{Glossary("HTTP", "HTTP-")}} és {{Glossary("Web Sockets", "WebSocket")}}-kiszolgálókat állíthassanak össze.

+ +

További tudnivalók

+ +

Általános ismeretek

+ + + +

A JavaScript megtanulása

+ + + +

Műszaki referencia

+ + diff --git a/files/hu/glossary/node.js/index.html b/files/hu/glossary/node.js/index.html new file mode 100644 index 0000000000..d886cbd416 --- /dev/null +++ b/files/hu/glossary/node.js/index.html @@ -0,0 +1,24 @@ +--- +title: Node.js +slug: Glossary/Node.js +translation_of: Glossary/Node.js +--- +

A Node.js egy többplatformú {{Glossary("JavaScript")}} futási környezet melynek segítségével szerveroldali és hálózati alkalmazásokat fejleszthetünk JavaScriptben.

+ +

Tudjon meg többet

+ +

Általános Ismeretek

+ + + +

Technical information

+ + + +
{{QuickLinksWithSubpages("/hu-HU/docs/Glossary")}}
diff --git a/files/hu/kozossegi_api/index.html b/files/hu/kozossegi_api/index.html new file mode 100644 index 0000000000..7ad4528f11 --- /dev/null +++ b/files/hu/kozossegi_api/index.html @@ -0,0 +1,56 @@ +--- +title: Közösségi API +slug: Kozossegi_API +translation_of: Archive/Social_API +--- +

A Közösségi API egy új API, hogy a webböngészőknek könnyebb legyen integrálni a közösségi média szolgáltatásokat. Amint egy közösségi szolgáltató bevezetésre kerül a Firefoxban, lehetővé válik a böngésző számára 'in-chrome' felhasználói vezérlők és a szolgáltatáshoz kapcsolodó információk megjelenítése. A következő cikkek leírják, hogyan vezessen be közösségi szolgáltatást.

+
+

Megjegyzés: Az aloldalakon lévő tartalom többsége kidolgozott de még nincs átmigrálva ebbe a fastruktúrába; átmenetileg itt találhatja meg.

+
+
+
+

Közösségi API dokumentáció

+

Ajánlás a közösségi szolgáltatás munkás API-hoz

+

Közösségi szolgáltatás tartalom API: MozSocial

+

Ajánlás a közösségi szolgáltatás tartalom API-hoz, amelyet a  {{domxref("navigator.MozSocial")}} objektum nyújt.

+

Közösségi szolgáltatás widgetek

+

Útmutató a közösségi szolgáltatás által nyújtott widgetekhez.

+

Chat funkció megvalósítása

+

Útmutató a chat jellemzők megvalósításához a Közösségi API használatával

+
+
+ Közösségi API szójegyzék
+
+ Provides definitions of key terms you'll need to understand when using the Social API.
+
+ Közösségi API és közösségi szolgáltatás útmutató
+
+ Bevezetés és útmutató a Közösségi API-hoz és a kapcsolodó szolgálgatásokhoz.
+
+ Közösségi szolgáltatás jegyzék
+
+ A jegyzék—(TBD: és útmutató az építéshez)—leírása szükséges.
+
+ Közösségi szolgáltatás munkás API ajánlás
+
+

Összes megtekintése....

+
+
+

Segítség kérése a közösségtől

+

Segítségre van szüksége a Közösségi API-val összefüggő problémában és nem találja a megoldást a dokumentációban?

+
    +
  • +

    Kérdezzen a Mozilla IRC csatornáján
    + #socialdev

    +
  • +
+

Ne felejtse a netikettet...

+

Eszközök és demók

+

Egy minta közösségi szolgáltatás a githubon.
+ Hogy használja a Firefox Fejlesztői Eszközeit a Közösségi API-val.

+

Összes megtekintése...

+ +

Webes alkalmazások megnyitása

+
+
+

 

diff --git a/files/hu/learn/html/bevezetes_a_html-be/index.html b/files/hu/learn/html/bevezetes_a_html-be/index.html new file mode 100644 index 0000000000..d5f2c7239a --- /dev/null +++ b/files/hu/learn/html/bevezetes_a_html-be/index.html @@ -0,0 +1,58 @@ +--- +title: Bevezetés a HTML-be +slug: Learn/HTML/Bevezetes_a_HTML-be +translation_of: Learn/HTML/Introduction_to_HTML +--- +
{{LearnSidebar}}
+ +
A {{glossary("HTML")}} alapvetően egy egyszerű nyelv. Olyan elemekből áll, amelyekkel különböző jelentést társíthatunk szövegrészleteknek (például egy bekezdés, egy számozott lista, egy táblázat sora), struktúrálhatjuk a dokumentumot logikai részekre (például fejléc, navigációs sáv, három oszlopos tartalom), vagy beilleszthetünk más tartalmakat az oldalunkba (például képeket vagy videót).
+ +
Ez a modul bemutatja ezek közül az első kettőt, és megismertet az alapvető fogalmakkal és a szintaxissal, amiket tudnod kell a HTML megértéséhez.
+ +

Előfeltételek

+ +

Mielőtt elkezded ezt a modult, tudnod kell pár dolgot.
+ A kezdéshez nincs szükséged előzetes HTML ismeretekre, ugyanakkor legalább alapszinten ismerned kell a számítógép és az internet használatát. Létre kell hoznod egy alapvető munkakörnyezetet (amit az Alapvető szoftverek telepítése útmutatónk részletesen ismertet), és tudnod kell, hogyan hozhatsz létre és kezelhetsz fájlokat (amit a Fájlok kezelése útmutatónk részletesen ismertet). Mindkettő része a Kezdő lépések modulnak.

+ +
+

Megjegyzés: Ha olyan számítógépen / táblagépen / vagy egyéb eszközön dolgozol, amelyen nem tudsz fájlokat létrehozni, próbáld ki (a legtöbb) példa kódot valamelyik online programban, mint amilyen a JSBin vagy a Thimble.

+
+ +

Útmutatók

+ +

Ez a modul olyan útmutatókat tartalmaz, amelyek végigvezetnek a HTML nyújtotta összes lehetőségen, és bőséges lehetőséget nyújtanak a képességeid tesztelésére.

+ +
+
HTML Alapok
+
Magában foglalja a HTML abszolút alapjait — definiáljuk az elemeket, attribútumokat, és más fontos paramétereket, valamint megmutatjuk hol illeszkednek a nyelvhez. Azt is megmutatjuk, hogy egy tipikus HTML oldal hogyan van struktúrálva illetve egy HTML elem hogyan van struktúrálva, valamint elmagyarázzuk milyen egyéb fontos nyelvi funkciók vannak. Útközben játszunk is egy kicsit a HTML-el, hogy felkeltsük az érdeklődésedet.
+
Mi van a head-ben? Metaadatok HTML-ben
+
A HTML-dokumentum feje (head) az a rész, amely nem jelenik meg a webböngészőben az oldal betöltésekor. Olyan információkat tartalmaz, mint például az oldal címe ({{htmlelement("title")}}), linkek a {{glossary("CSS")}} fájlokra, az egyedi ikonok elérési útvonalai, illetve a metaadatok (adatok a HTML-ről, például arról, hogy ki írta, vagy a dokumentumot leíró fontos kulcsszavakat).
+
HTML szöveg alapjai
+
A HTML egyik fő feladata, hogy jelentést adjon a szövegnek (más néven szematika), hogy a böngésző tudja, hogyan kell helyesen megjeleníteni. Ez a cikk megmutatja hogyan tördelheted fel a szöveget fejlécekre és bekezdésekre, hogyan hangsúlyozhatsz szavakat, vagy készíthesz listákat és egyebeket HTML segítségével..
+
Hivatkozások létrehozása
+
A hivatkozások (hyperlinks) nagyon fontosak — ők teszik az internetet internetté. Ez a cikk egy link elkészítéséhez szükséges szintaxist mutat be, illetve bemutat néhány praktikát.
+
Speciális szövegformázás
+
Rengeteg elem van a HTML-ben a szövegek formázására, amelyeket a HTML szöveg alapjai cikkben nem találsz meg. Ezek az elemek kevésbé ismertek, pedig ismeretük még mindig hasznos lehet. Ebben a cikkben megtanulhatod az idézetek, a leírási listák, a számítógépes kódok és egyéb kapcsolódó szövegek, úgy mint indexek, felső indexek vagy kapcsolati adatok megjelölését.
+
Dokumentum- és weboldalszerkezet
+
Az oldal egyes részeinek (például bekezdés vagy kép) meghatározása mellett a HTML-t arra is használják, hogy meghatározza webhely területeit (például fejléc, lábléc, navigációs sáv, tartalom). Ez a cikk megvizsgálja, hogyan kell megtervezni egy alapvető webhelystruktúrát, illetve hogyan kell megírni HTML-ben.
+
Hibakeresés HTML-ben
+
HTML-t írni szuper, de mi van akkor, ha valamit elromlik és nem találod a hibát? Ez a cikk bemutat néhány eszközt, amely segíthet.
+
+ +

Tesztek

+ +

Ezekkel a tesztekkel ellenőrizheted, hogy mennyire sikerült megértened a fenti útmutatókban leírtakat.

+ +
+
Egy levél írása 
+
Mindannyian megtanulunk egy levelet írni előbb vagy utóbb; ez egy hasznos példa a szövegformázási készségek tesztelésére. Ebben a tesztben egy levelet kell megformázni.
+
Egy tartalom oldalának strukturálása
+
Ez a tesz ellenőrzi hogyan tudsz struktúrálni HTML-el egy oldalt, amely tartalmaz fejlécet, láblécet, navigációs sávot, egy fő tartalmat és egy oldalsávot.
+
+ +

Kapcsolódó témakörök

+ +
+
A webes műveltség alapjai 1
+
Egy kiváló Mozilla alapítványi tanfolyam, amely a Bevezetés a HTML-be c. útmutatóban bemutatott sok készség vizsgálatára és tesztelésére szolgál. A tanulók megismerkedhetnek az olvasással, az írással és a weben való részvételellel ebben a hat részből álló modulban. Fedezze fel a web alapjait a alkotás és az együttműködés révén.
+
diff --git a/files/hu/learn/html/index.html b/files/hu/learn/html/index.html new file mode 100644 index 0000000000..df97989e28 --- /dev/null +++ b/files/hu/learn/html/index.html @@ -0,0 +1,58 @@ +--- +title: 'Learning HTML: Guides and tutorials' +slug: Learn/HTML +tags: + - Beginner + - Guide + - HTML + - Intro + - Learn + - NeedsTranslation + - Topic + - TopicStub +translation_of: Learn/HTML +--- +
{{LearnSidebar}}
+ +

To build websites, you should know about {{Glossary('HTML')}} — the fundamental technology used to define the structure of a webpage. HTML is used to specify whether your web content should be recognized as a paragraph, list, heading, link, image, multimedia player, form, or one of many other available elements or even a new element that you define.

+ +

Learning pathway

+ +

Ideally, you should start your learning journey by learning HTML. Start by reading Introduction to HTML. You may then move on to learning about more advanced topics such as:

+ + + +

Before starting this topic, you should have at least basic familiarity with using computers and using the web passively (i.e. just looking at it, consuming the content). You should have a basic work environment set up as detailed in Installing basic software, and understand how to create and manage files, as detailed in Dealing with files — both are parts of our Getting started with the web complete beginner's module.

+ +

It is recommended that you work through Getting started with the web before attempting this topic, however, it isn't absolutely necessary; much of what is covered in the HTML basics article is also covered in our Introduction to HTML module, albeit in a lot more detail.

+ +

Modules

+ +

This topic contains the following modules, in a suggested order for working through them. You should definitely start with the first one.

+ +
+
Introduction to HTML
+
This module sets the stage, getting you used to important concepts and syntax, looking at applying HTML to text, how to create hyperlinks, and how to use HTML to structure a webpage.
+
Multimedia and embedding
+
This module explores how to use HTML to include multimedia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages.
+
HTML Tables
+
Representing tabular data on a webpage in an understandable, {{glossary("Accessibility", "accessible")}} way can be a challenge. This module covers basic table markup, along with more complex features such as implementing captions and summaries.
+
HTML Forms
+
Forms are a very important part of the Web — these provide much of the functionality you need for interacting with websites, e.g. registering and logging in, sending feedback, buying products, and more. This module gets you started with creating the client-side parts of forms.
+
+ +

Solving common HTML problems

+ +

Use HTML to solve common problems provides links to sections of content explaining how to use HTML to solve very common problems when creating a webpage: dealing with titles, adding images or videos, emphasizing content, creating a basic form, etc.

+ +

See also

+ +
+
+
HTML (HyperText Markup Language) on MDN
+
The main entry point for HTML documentation on MDN, including detailed element and attribute references — if you want to know what attributes an element has or what values an attribute has, for example, this is a great place to start.
+
+
diff --git a/files/hu/learn/index.html b/files/hu/learn/index.html new file mode 100644 index 0000000000..55b880bac6 --- /dev/null +++ b/files/hu/learn/index.html @@ -0,0 +1,130 @@ +--- +title: A webfejlesztés megtanulása +slug: Learn +tags: + - CSS + - HTML + - Kezdő + - Tanulás + - Web + - bevezetés + - tartalomjegyzék +translation_of: Learn +--- +
{{LearnSidebar}}
+ +
+ +
+

Üdvözlünk az MDN tanulórészlegén! Az itt található témakörök elsődleges célja, hogy kezdő fejlesztők könnyedén megtalálhassák azokat az információkat, amelyek szükségesek az egyszerű weboldalak elkészítéséhez.

+
+ +

Nem az a célunk, hogy kezdőből szakértőt faragjunk belőled, hanem kezdőből középhaladót. Onnantól kezdve már elindulhatsz a saját utadon, ahonnan már könnyedén tanulhatsz az MDN többi részéből és más középhaladó és haladó anyagokból, amelyekhez már sok előzetes tudás szükséges.

+ +

Ha abszolút kezdő vagy, akkor a webfejlesztés nagy kihívás lehet, de segítünk neked, és biztosítjuk számodra a szükséges információkat ahhoz, hogy kényelmesen és jól megtanuld a különböző témákat. Érezd magad otthon akkor is, ha csak diákként böngészel, ha tananyagot keresel a diákjaidnak, vagy csak hobbiként szeretnél többet megtudni a webes technológiák működéséről!

+ +

Újdonságok

+ +

A tanulórészleg tartalma rendszeresen bővül. A változások követéséhez elindítottuk a Tanulórészleg kiadási megjegyzései oldalt – nézz vissza rendszeresen.

+ +

Ha kérdésed van az itt tárgyalt témákkal kapcsolatban, vagy úgy érzed, hogy valami hiányzik, akkor küldj nekünk egy üzenetet a Discourse fórumunkon.

+ +

Front-end webfejlesztő szeretnél lenni?

+ +

Összeraktunk egy oktatóanyagot, amely tartalmazza az összes alapvető információt, amire szükséged lesz a cél elérése érdekében.

+ +

Fogj hozzá

+ +

Hol kezdjük?

+ + + +
+

Megjegyzés: Szószedetünkben megtalálhatod a szaknyelvi definíciókat.  Emellett pedig ha konkrét kérdésed van a webfejesztésről, akkor a Gyakori kérdések szakaszunk lehet, hogy segíteni fog.

+
+ +

{{LearnBox({"title":"Véletlenszerű bejegyzés a szószedetből"})}}

+ +

Lefedett témakörök

+ +

Itt egy lista az MDN tanuló oldal által lefedett témakörökről.

+ +
+
Ismerkedés a webfejlesztéssel
+
Gyakorlati bevezető a webfejlesztésbe teljesen kezdőknek.
+
HTML – a web szerkezetének kialakítása
+
A HTML nyelv segítségével alakítjuk ki oldalaink szerkezetét és adunk jelentést, illetve célt a tartalmunknak. Ez a témakör részletesen bemutatja a HTML nyelvet.
+
CSS – a web dizájnolása
+
A CSS nyelv segítségével tudjuk a weboldalaink stílusát, elrendezését megadni, valamint viselkedést rendelhetünk oldalunkhoz, például animációkkal. Ez a témakör átfogó képet nyújt a CSS-ről.
+
JavaScript – dinamikus kliensoldali programozás
+
A Javascript szkript nyelv dinamikus funkcionalitást ad a weboldalakhoz. Ez a témakör megtanítja azokat az alapvető dolgokat, amelyek ahhoz szükségesek, hogy magabiztosan megértsük és írjunk Javascript kódot.
+
Akadálymentesítés – tegyük mindenki számára elérhetővé a webet
+
Az akadálymentesítés az a gyakorlat, amellyel a webes tartalmakat minél szélesebb rétegek számára elérhetővé tesszük fogyatékosság, használt eszköz, földrajzi elhelyezkedés vagy egyéb megkülönböztető tényezőktől függetlenül. Itt mindent megtanulhatsz, amit tudnod kell erről a témáról.
+
Eszközök és tesztelés
+
Ebben a témakörben megismerheted a fejlesztők mindennapi munkája során használt eszközöket, mint például a különböző böngészők tesztelésére használt eszközök.
+
Kiszolgálóoldali webfejlesztés
+
Még ha a kliensoldali fejlesztés is a fő fókuszod, akkor is érdemes tudnod róla hogyan működnek a kiszolgálók, illetve a kiszolgálóoldali kódok. Ez a témakör általános leírást ad a kiszolgálóoldal működéséről, és részletes bemutatót találhatsz arról, hogyan kell felépíteni egy kiszolgálóoldali alkalmazást két népszerű keretrendszer segítsével: a Djangóval (Python) és az Expressel (node.js).
+
+ +

Példakódok megszerzése

+ +

A tanulórészlegen található összes kódpélda elérhető GitHubon. Ha le akarod másolni őket a számítógépedra, akkor a legegyszerűbb megoldás a master ág legfrissebb verziójának letöltése ZIP-fájlként.

+ +

Ha inkább a tárolót másolnád le, amely rugalmasabb és lehetővé teszi az automatikus frissítéseket, akkor kövesd a bonyolultabb utasításokat:

+ +
    +
  1. Telepítsd a Gitet a számítógépre. Ez a verziókezelő rendszer, amelyre a GitHub is épít.
  2. +
  3. Nyisd meg a számítógép parancssorát (Windows) vagy a terminált (Linux, macOS).
  4. +
  5. A tanulórészleg tárolójának egy „learning-area” mappába másolásához a jelenlegi munkakönyvtárban, használd a következő parancsot: +
    git clone https://github.com/mdn/learning-area
    +
  6. +
  7. Beléphetsz a könyvtárba, és kikeresheted a megfelelő fájlokat (vagy a Finderrel/Fájlkezelővel, vagy a cd paranccsal).
  8. +
+ +

A következő lépésekkel frissítheted a learning-area tárolót a GitHubon lévő „master” verzió módosításaival:

+ +
    +
  1. A parancssorban/terminálban válts a learning-area könyvtárra a cd segítségével. Például, ha a szülőkönyvtárban vagy: + +
    cd learning-area
    +
  2. +
  3. Frissítsd a tárolót a következő paranccsal: +
    git pull
    +
  4. +
+ +

Lépj kapcsolatba velünk

+ +

Ha szeretnél kapcsolatba lépni velünk bármivel is kapcsolatban, a legjobb módszer arra ha dobsz egy üzenetet a Discourse fórumunkra. Ha bármi észrevételed lenne, hiányzik valami az oldalról, valami nem állja meg a helyét, szeretnél egy új témát, nem értesz valamit, vagy bármi, nyugodtan írj nekünk.

+ +

Ha szeretnéd a tartalmat bővíteni, vess egy pillantást a hogyan tudok segíteni oldalra vagy lépj velünk kapcsolatba! Csupa öröm ha felveszitek velünk a kapcsolatot legyél akár tanár, diák, vagy tapasztalt webfejlesztő.

+ +

Lásd még

+ +
+
Mozilla fejlesztői hírlevé developer newsletter
+
A hírlevelünk webfejlesztők számára, ami kiváló információforrás minden tapasztalati szinten.
+
Learn JavaScript
+
Egy kiváló forrás jövőbeli webfejlesztők számára – a Learn JavaScript egy interaktív környezet, rövid leckékkel és interaktív tesztekkel, melyet automata értékelés segít. Az első 40 lecke ingyenes, a teljes kurzus kis összegű, egyszeri fizetés fejében érhető el.
+
Web demystified
+
Egy nagyszerű videósorozat a web alapjairól, kifejezetten azokat célozva, akik abszolút kezdők a webfejlesztésben. Készítette: Jérémie Patonnier.
+
Codecademy
+
Nagyszerű interaktív oldal programozási nyelvek az alapoktól történő tanulására.
+
BitDegree
+
Alapvető kódoláselmélet játékosított tanulási folyamattal. Főleg kezdőket céloz.
+
Code.org
+
Alapvető kódoláselmélet játékosított tanulási folyamattal. Főleg gyerekeket és teljesen kezdőket céloz.
+
EXLskills
+
Ingynes és nyílt kurzusok műszaki készségek tanításához, mentorálással és projektalapú tanulással.
+
freeCodeCamp.org
+
Interaktív oldal oktatóanyagokkal és projektekkel a webfejlesztés elsajátításához.
+
Webes írástudási térkép
+
Egy keretrendszer belépőszintű webes írástudáshoz és 21. századi készségekhez, amelyek kategóriánkénti oktatási tevékenységeket is biztosítanak.
+
Edabit
+
Interaktív JavaScript kihívások ezrei.
+
diff --git "a/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/alapvet\305\221_programok_telep\303\255t\303\251se/index.html" "b/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/alapvet\305\221_programok_telep\303\255t\303\251se/index.html" new file mode 100644 index 0000000000..463216fd9f --- /dev/null +++ "b/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/alapvet\305\221_programok_telep\303\255t\303\251se/index.html" @@ -0,0 +1,78 @@ +--- +title: Alapvető programok telepítése +slug: Learn/Ismerkedés_a_Világhálóval/Alapvető_programok_telepítése +tags: + - Kezdő + - böngésző + - ezközök + - kódszerkesztő + - programok + - szövegszerkesztő +translation_of: Learn/Getting_started_with_the_web/Installing_basic_software +--- +
{{LearnSidebar}}
+ +
{{NextMenu("Learn/Getting_started_with_the_web/What_will_your_website_look_like", "Learn/Getting_started_with_the_web")}}
+ +
+

Ebben a cikkben megmutatjuk milyen programokra lesz szükségünk egyszerű weboldalak fejlesztéséhez.

+
+ +

Milyen eszközöket használnak a profi webfejlesztők?

+ + + +

Mire van feltétlenül szükségem a kezdéshez?

+ +

Habár a fenti lista elsőre rémisztőnek tűnhet, a jó hír az, hogy ezeknek csupán egy töredéke szükséges a kezdéshez.

+ +

A továbbiakban a két legszükségesebbre fókuszálunk: egy alkalmas szövegszerkesztőre és böngészőkre.

+ +

Kódszerkesztő

+ +

Szinte bizonyos, hogy már van valamilyen kódolásra alkalmas szövegszerkesztő a számítógépünkön. Windowson a Jegyzettömb, macOS esetén a TextEdit elő van telepítve. Linux esetén disztribúciófüggő az alapértelmezett szerkesztő, Ubuntu esetén ez a gedit.

+ +

Habár ezekkel a programokkal lehetséges kódot írni, vannak jobb alternatívák. A Visual Studio Code egy igen népszerű ingyenes kódszerkesztő, kimondottan programozást támogató funkciókkal.

+ +

Modern böngészők

+ +

Tekintsük az operációs rendszerünknek megfelelő böngészők listáját és telepítsük őket a megadott linkek segítségével. Erősen ajánlott  legalább két böngészőt telepíteni, mielőtt elkezdjük a tanulást, de a későbbi teszteléshez javasolt mindegyiknek a telepítése.

+ + + +
+

Figyelem: Az Internet Explorer nem kompatibilis némely modern webes technológiákkal, így előfordulhat, hogy nem tudja futtatni a projektünket. Általánosságban azonban elmondható, hogy nem kell aggódnunk az Internet Explorer miatt, mivel manapság nagyon kevesen használják — ugyanakkor az is előfordulhat, hogy olyan projektbe botlunk, ahol fontos az Internet Explorer támogatása.

+
+ +

Helyben futó webszerver

+ +

Egyes példák futtatásához egy működő webszerverre lesz szükségünk. A How do you set up a local testing server? cikk részletesen bemutatja, hogyan tudunk konfigurálni egyet.

+ +

{{NextMenu("Learn/Getting_started_with_the_web/What_will_your_website_look_like", "Learn/Getting_started_with_the_web")}}

+ +

Modul tartalomjegyzék

+ + diff --git "a/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/hogy_fog_kin\303\251zni_a_weboldalunk/index.html" "b/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/hogy_fog_kin\303\251zni_a_weboldalunk/index.html" new file mode 100644 index 0000000000..374aae6c40 --- /dev/null +++ "b/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/hogy_fog_kin\303\251zni_a_weboldalunk/index.html" @@ -0,0 +1,92 @@ +--- +title: Hogy fog kinézni a weboldalunk +slug: Learn/Ismerkedés_a_Világhálóval/Hogy_fog_kinézni_a_weboldalunk +translation_of: Learn/Getting_started_with_the_web/What_will_your_website_look_like +--- +
{{LearnSidebar}}
+ +
{{PreviousMenuNext("Learn/Getting_started_with_the_web/Installing_basic_software", "Learn/Getting_started_with_the_web/Dealing_with_files", "Learn/Getting_started_with_the_web")}}
+ +
+

Ebben a cikkben áttekintjük a weboldalunk kódolása előtt szükséges alapvető tervezési lépéseket. Milyen tartalmat fogunk megjeleníteni? Milyen betűtípusokat és színeket képzelünk el? Egyáltalán, mi a weboldal legfőbb célja?

+
+ +

Első lépés: tervezés

+ +

Miről fog szólni a weboldalunk? Mi lesz a célja? Kezdésnek valami egyszerűre törekedjünk, például egy cím, egy kép és néhány bekezdés valamilyen konkrét dologról.

+ +

Alapvető kérdések:

+ +
    +
  1. Miről szóljon? Mi az ami érdekel? Kutyák? New York? Pac-Man?
  2. +
  3. Mi lesz a konkrét megjelenített tartalom? Írjunk néhány bekezdést, találjunk ki egy címet és keressünk egy képet.
  4. +
  5. Hogy fog kinézni az oldal? Nem kell mindent részletesen kitalálni előre, de jó, ha legalább az elrendezést, a háttérszíneket és a betűstílust nagyvonalakban meghatározzuk. Milyen kisugárzást szeretnénk? Hivatalosat? Vicceset? Figyelemfelhívót? Esetleg valami diszkrétet?
  6. +
+ +
+

Megjegyzés: A komplex projektek tervezése nagyságrendekkel bonyolultabb. Méretek, térközök, fogalmazási stílus, és így tovább. Ezeket az előírásokat egy úgynevezett design systemben (vagy más néven brand bookban) szokás összefoglalni.  Íme egy példa, a Firefox Photon Design System.

+
+ +

Vázlatos arculati terv

+ +

Ragadjunk papírt és ceruzát és skicceljük fel a weboldalunkat. Habár egy kép és néhány bekezdés esetén ez feleslegesnek tűnhet, valójában nagyon sokat segít, ha van egy hozzávetőleges ábránk arról, hogy mit is szeretnénk pontosan, ezért nem árt, ha már most hozzászokunk a folyamathoz.

+ +

+ +
+

Megjegyzés: Még egy nagy, összetett weboldal esetén is gyakran ilyen egyszerű papíros vázlatokkal kezdődik a tervezés és az alapvető elképzelések megszilárdulása után készülnek digitális tervek, kattintható prototípusok.

+ +

A webes csapatoknak sokszor tagja egy grafikus és egy {{Glossary("UX", "user experience")}} (UX, felhaszálói élmény) designer. A grafikus felel a megjelenés részletes megtervezéséért, míg a UX designer a weboldal megjelenési és működési alapvetéseit határozza meg úgy, hogy az felhasználóbarát legyen váljon.

+
+ +

Weboldal elemeinek összeállítása

+ +

Eljött az idő, hogy összeszedjük, pontosan mit is tartalmazzon a weboldalunk.

+ +

Szöveges tartalom

+ +

Írjuk meg a konkrét szöveges tartalmat, ha még nem tettük volna meg.

+ +

Szín téma

+ +

Nyissuk meg az MDN színválasztó segédeszközét és válasszunk egy színt a weboldal általános szín témájának. Miután kiválasztottunk egy színt, egy #660066 alakú kódot fogunk látni. Ez egy hexa-kód (hexadecimális, tizenhatos számrendszerbeli). Ez azonosítja a kiválasztott színt. Írjuk fel valahova.

+ +

+ +

Képek

+ +

Keressünk felhasználható képeket az Interneten (pl. Google Képek segítségével).

+ +
    +
  1. Az egyes képekre kattintva egy előnézetet kapunk, egyéb adatokkal (pl. felbontás)
  2. +
  3. Mentsük el a képet a számítógépre.
  4. +
+ +

+ +

Ne feledjük, hogy a legtöbb kép, így azok is, amelyeket a Google keresőjén keresztül találunk, jogvédettek. Használjuk a kereső licensz szűrőjét, hogy csökkentsük a szerzői jogok megsértésének valószínűségét.

+ +

+ +

Betűtípus

+ +

Látogassunk el a Google Fonts oldalra és keressünk egy nekünk tetsző betűtípust. Használjuk a szűrőbeállításokat a keresés megkönnyítésére.

+ +

+ +

+ +

{{PreviousMenuNext("Learn/Getting_started_with_the_web/Installing_basic_software", "Learn/Getting_started_with_the_web/Dealing_with_files", "Learn/Getting_started_with_the_web")}}

+ +

Modul tartalomjegyzék

+ + diff --git "a/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/index.html" "b/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/index.html" new file mode 100644 index 0000000000..38c28abba1 --- /dev/null +++ "b/files/hu/learn/ismerked\303\251s_a_vil\303\241gh\303\241l\303\263val/index.html" @@ -0,0 +1,60 @@ +--- +title: Ismerkedés a Világhálóval +slug: Learn/Ismerkedés_a_Világhálóval +tags: + - CSS + - HTML + - Kezdő + - útmutató +translation_of: Learn/Getting_started_with_the_web +--- +
{{LearnSidebar}}
+ +
+

Az Ismerkedés a Világhálóval egy rövid cikksorozat, amelyben a webfejlesztés gyakorlati mibenlétét mutatjuk be. Áttekintjük a szükséges eszközöket, írunk egy egyszerű weboldalt és publikáljuk a munkánkat.

+
+ +

Első weboldalunk születése

+ +

Egy professzionális weboldal elkészítése rengeteg munka, így a tanulást mindenképpen kicsiben érdemes kezdeni. Nem fogunk rögtön egy újabb Facebookot írni, de egy egyszerű weboldal elkészítése meglepően könnyű feladat, úgyhogy ezzel indítunk.

+ +

Az alábbi cikkek úgy vannak összeállítva, hogy sorban haladva segítsenek minket megírni és közzétenni első weboldalunkat, teljesen nulláról. Fogjunk hát hozzá!

+ +

Alapvető programok telepítése

+ +

Számtalan program és eszköz áll rendelkezésre a weboldalak fejlesztéséhez és teszteléséhez.  Az Installing basic software cikkben segítünk eligazodni ezek között és bemutatjuk a kezdés szempontjából legfontosabb eszközöket.

+ +

Hogy fog kinézni a weboldalunk?

+ +

Mielőtt nekilátunk a weboldalunk lekódolásának, meg kell terveznünk azt. Milyen tartalmat akarunk pontosan megjeleníteni? Milyen betűtípust és színeket akarunk használni? A  What will your website look like? cikkben lépésről lépésre végigvezetünk egy alapvető tervezési folyamaton.

+ +

Fájlokkal való munka

+ +

Egy weboldal sok-sok különféle fájlból áll: szöveges fájlok, programkód, síluslapok, képek, videók, és még sorolhatnánk. Hogyan tudjuk ezt a sok fájlt egy összefüggő weboldallá gyúrni? És hogyan rendszerezzük a fájljainkat hatékonyan? Ezekre a kérdésekre válaszol a Dealing with files cikk.

+ +

HTML alapok

+ +

A HTML (Hypertext Markup Language, hiperszöveg jelölőnyelv) kód segítségével strukturálhatjuk a weboldalunk tartalmát, azaz megadhatjuk, hogy melyek a címsorok, hogy a szöveget miként tagoljuk bekezdésekre, felsorolásokra, mit kell táblázatosan megjeleníteni, hova kell képet beilleszteni és így tovább. A HTML basics cikkben a legfontosabb HTML elemeket tekintjük át.

+ +

CSS alapok

+ +

A CSS (Cascading Stylesheets, lépcsőzetes stíluslapok) kód segítségével tudjuk színezni, méretezni, háttérképekkel dísziteni, pozícionálni, egyszóval formázni a weboldalunk tartalmát. A CSS basics cikkben elmagyarázzuk az alapvető fogalmakat és bemutatunk néhány CSS formázási példát.

+ +

JavaScript alapok

+ +

A JavaScript programozási nyelv teszi lehetővé, hogy dinamikus, interaktív weboldalakat hozzunk létre. Néhány példa a JavaScript alkalmazására: komplett játékok, kattintásra megjelenő elemek, űrlapok ellenőrzése, dinamikusan változó színek, animációk. A JavaScript basics cikk ismerteti a JavaScript programozás alapjait és egy példán keresztül bemutatja, mi minden lehetséges a használatával.

+ +

Weboldalunk közzététele

+ +

Miután végeztünk a weboldalunk lekódolásával, elérhetővé kell tennünk az Interneten. A Publishing your sample code cikk bemutatja a lehetőségeinket és segít közzétenni az oldalunkat egy egyszerű módszerrel.

+ +

Hogy működik a Világháló?

+ +

Amikor megnyitunk egy weboldalt, egy sor bonyolult folyamat zajlik a háttérben. A How the web works cikk ezeket a folyamatokat mutatja be nagyvonalakban.

+ +

Lásd még

+ + diff --git "a/files/hu/learn/javascript/els\305\221_l\303\251p\303\251sek/index.html" "b/files/hu/learn/javascript/els\305\221_l\303\251p\303\251sek/index.html" new file mode 100644 index 0000000000..7276a4541c --- /dev/null +++ "b/files/hu/learn/javascript/els\305\221_l\303\251p\303\251sek/index.html" @@ -0,0 +1,66 @@ +--- +title: Első lépések JavaScript-ben +slug: Learn/JavaScript/Első_lépések +tags: + - Cikk + - JavaScript + - Kezdő + - Modul + - Operátorok + - Számok + - Tömbök + - Változók + - matek + - stringek + - Érkező + - Értékelés + - útmutató +translation_of: Learn/JavaScript/First_steps +--- +
{{LearnSidebar}}
+ +

Az első JavaScript modulunkban, először válaszolunk néhány alapvető kérdésre mint például "mi a JavaScript?", "hogyan is néz ki?", és "mit is csinál?", mielőtt továbblépne az első gyakorlati tapasztalatának megszerzéséhez a JavaScript-ről. Ezután, megvitatunk néhány kulcsfontosságú épitőelemet, mint a változók, stringek, számok és tömbök.

+ +

Előfeltételek

+ +

A modul elkezdése előtt nem szükséges bármiféle előzetes JavaScript tudás, de ajánlott tisztában lennie a HTML- és CSS-sel. Javasoljuk, hogy nézze át a következő modulokat a JavaScript elkezdése előtt:

+ + + +
+

Jegyzet:  Ha olyan számítógépen/tableten/más eszközön dolgozik, ahol nem nem tud saját fájlokat készíteni, akkor ki tudja próbálni (a legtöbb) a kód példákat egy online kódoló programmal, mint a JSBin vagy a Thimble.

+
+ +

Útmutatók

+ +
+
Mi a JavaScript
+
Üdvözöljük az MDN kezdő JavaScript kurzusán! Ebben az első cikkben a JavaScriptet magas szintről fogjuk megtekinteni, válaszolni kérdésekre, mint "mi ez?", és "mit csinál?", és meggyőződni arról, hogy kényelmes-e a JavaScript szándéka.
+
Az első merülés a JavaScript-be
+
Most, hogy tanult valamit a JavaScript elméletéről, és hogy mit tud vele csinálni, adunk önnek egy "crash" kurzust a JavaScript alapvető tulajdonságairól egy teljes gyakorlati oktatás során. Itt el fog készíteni egy egyszerű "Találd ki a számot" játékot lépésről lépésre.
+
Mi romlott el? Hibaelhárítás JavaScript-ben
+
Amikor elkészítette a "Találd ki a számot" játékot az előző cikkben, talán észrevette hogy nem működik. Sose féljen — ez a cikk arra törekszik, hogy megmentse önt a haj tépéstől az ilyen problémák miatt azzal, hogy ellátja önt néhány egyszerű tippel, hogy hogyan tudja megkeresni, és kijavítani a hibákat JavaScript programokban.
+
Szükséges információk tárolása - Változók
+
Az előző cikkek elolvasása után mostmár tudnia kell mi is a JavaScript, mit tud önért csinálni, hogyan használja azt más webes technológiák mellett, és mik a főbb jellemzői magasabb szintől nézve. Ebben a cikkben leereszkedünk az igazi alapokhoz, és megnézzük hogyan dolgozzunk a JavaScript legalapabb építőelemeivel — Változók.
+
Alapvető matematika JavaScriptben — számok és operátorok
+
A kurzus ezen pontján megvitatjuk a matematikát JavaScript-ben — hogy tudunk kombinálni operátorokat és más jellemzőket, hogy sikeresen manipuláljunk számokat parancsunk végrehajtásához.
+
Szöveg kezelés — stringek JavaScript-ben
+
Ezután a stringekre fordítjuk figyelmünket — ez az, amit szövegnek nevezünk a programozásban. Ebben a cikkben sorra vesszük az összes gyakori dolgot amit valóban tudnia kell a stringekről amikor JavaScript-et tanul, mint például stringet létrehozni, idézőjelek elhagyása stringben, és egyesíteni őket.
+
Hasznos string metódusok(eljárások)
+
Már megnéztük a stringek alapjait, lépjünk egy szinttel feljebb és kezdjünk gondolkodni arról, milyen hasznos eljárásokat tudunk végrehajtani stringeken a beépített methódusokkal, mint megkeresni a hosszát egy szövegnek, egyesíteni és szétválasztani stringeket, helyettesíteni egy karaktert egy stringben egy másikra, és még sok más.
+
Tömbök
+
A modul utolsó cikkében a tömböket vesszük szemügyre — elegáns módja egy lista elemeinek tárolására egy egyszerű változó név alatt. Megnézzük miért is olyan hasznos, ezután felfedezzük hogyan csináljunk tömböket, kapjunk, hozzáadjunk, és töröljünk elemeket amelyek tömbben vannak tárolva, és ezen kívül sok más.
+
+ +

Felmérés

+ +

A következő felmérés tesztelni fogja, hogy megértette a JavaScript alapjait, amelyeket a fenti útmutatóban lefedünk.

+ +
+
Ostoba történet generálása
+
Ebben a felmérésben tesztelve lesz, amelyben szükség lesz a tudására, amelyet elsajátított ennek a modulnak a cikkeiben, hogy ezeket felhasználva készítsen egy vicces app-ot, ami véletleszerűen generál ostoba történeteket. Jó szórakozást!
+
diff --git a/files/hu/learn/javascript/index.html b/files/hu/learn/javascript/index.html new file mode 100644 index 0000000000..7a81dde404 --- /dev/null +++ b/files/hu/learn/javascript/index.html @@ -0,0 +1,56 @@ +--- +title: JavaScript +slug: Learn/JavaScript +translation_of: Learn/JavaScript +--- +
{{LearnSidebar}}
+ +

{{Glossary("JavaScript")}} egy programozási nyelv, mely segítségével összetett dolgokat hozhatunk létre weboldalakon.— Minden alkalommal mikor a böngésző többet tesz annál hogy csak ül és néz ki a fejéből, valamint statikus információkat jeleníti meg, akkor már JavaScriptről beszélünk.

+ +

A hosszú út

+ +

JavaScript vitathatatlanul nehezebb megtanulni, mint jóbarátait, HTML-t és CSS-t. Mielőtt nekivágnál a JavaScript tanulásának, erősen ajánlott hogy ismerd, tudd használni a fent említett web technológiákat. Kezd a következő modulok ismeretének elsajátításával:

+ + + +

Ha rendelkezel tapasztalatokkal előző nyelvekből, az csak előnyödre válhat.

+ +

Miután megismerkedtél a JavaScript alapjaival, ajánljuk a következő haladó szintű témakörökkel, mint például.: 

+ + + +

Modulok

+ +

Mostani cikkünk sorrendben tartalmazza azokat a modulokat, amiket érdemes kidolgoznod, átdolgoznod. 

+ +
+
JavaScript első lépések
+
Mielőtt belevágnál a gyakorlati tapasztalatszerzének, ebben a cikkben szeretnénk válaszolni pár alapvető kérdésre, mint például "Mi az a JavaScript?", "Hogyan is néz ki?", "Mire használhatom?". Azután, átbeszélünk néhány fontos JavaScript tulajdonságot,jellegzetességet, mint a változók (variables), stringek, számok, és tömbök (arrays).
+
JavaScript épitő kockák
+
Ebben a modulban folytatjuk a JavaScript tulajdonságainak felfedezését, figyelmünket a leggyakrabban előforduló kód blokkok felé irányítjuk, többek között feltételek, állítások, loopok, függvények, és eseményekre.
+
Bevezetés a JavaScript objektumokba
+
A JavaScriptben a legtöbb dolog objektum, az alapvető JavaScript sajátosságoktól kezdve, mint például a stringek, vagy tömbök . Te is elkészítheted a saját objektumodat, objektumjaidat, amiben eltárolhatod az objektumhoz tartozó függvényeidet, változóidat. A JavaScript természetéből adódódan (Objektum orientált) fontos megértenünk, hogy az objektumok ismerete hasznos a hatékony kódok előállításához. Ebben sokat fog segíteni ez a modul. Itt megtanítjuk mindazt ami szükséges számodra az objektumok megértéséhez, többek között a szinktaktikáját, hogyan készíthetsz saját objektumot, valamint elmagyarázzuk mi is az a JSON adat, és hogyan dolgozunk vele.
+
Kliens oldali web API-k
+
Amikor kliens oldali JavaScriptet írsz a weboldalod vagy applikációd számára, biztos lehetsz benne hogy nem fogsz távol állni az API-k használatától - Interfészek a böngésző, valamint az operációs rendszer sajátosságainak manipulálására, vagy akár más adatok használata különböző weboldalakról. Ebben a modulban megismerkedünk az API-kal, valamint azzal, hogy mégis hogyan használjuk őket.
+
+ +

Gyakran előforduló JavaScript hibák megoldása

+ +

Használj JavaScriptet gyakori problémák megoldására cikkünk segítségével megértheted, hogyan oldhatsz meg gyakran előforduló hibákat mikor weboldalakat készítesz. 

+ +

További csemege

+ +

JavaScript on MDN

+ +
+
Ütőkártya a JavaScript magjának felkutatására. Itt elég jól kiterjesztett dokumentációt találhatsz minden tulajdonságra, aspektusra, és néhány haladó szintű cikk is jó szívvel említi, és beszél róla.
+
Coding math
+
Hasznos videó alapú gyakorlatok Keith Peters által, melyek megtanítják azt a matematikát, amit meg kell értened hogy hatékony programozó váljon belőled.
+
diff --git a/files/hu/learn/server-side/index.html b/files/hu/learn/server-side/index.html new file mode 100644 index 0000000000..8fcc639d2c --- /dev/null +++ b/files/hu/learn/server-side/index.html @@ -0,0 +1,59 @@ +--- +title: Server-side website programming +slug: Learn/Server-side +tags: + - Beginner + - CodingScripting + - Intro + - Landing + - Learn + - NeedsTranslation + - Server + - Server-side programming + - Topic + - TopicStub +translation_of: Learn/Server-side +--- +
{{LearnSidebar}}
+ +

The Dynamic Websites  Server-side programming topic is a series of modules that show how to create dynamic websites; websites that deliver customised information in response to HTTP requests. The modules provide a general introduction to server-side programming, along with specific beginner-level guides on how to use the Django (Python) and Express (Node.js/JavaScript) web frameworks to create basic applications.

+ +

Most major websites use some kind of server-side technology to dynamically display data as required. For example, imagine how many products are available on Amazon, and imagine how many posts have been written on Facebook. Displaying all of these using different static pages would be extremely inefficient, so instead such sites display static templates (built using HTML, CSS, and JavaScript), and then dynamically update the data displayed inside those templates when needed, such as when you want to view a different product on Amazon.

+ +

In the modern world of web development, learning about server-side development is highly recommended.

+ +

Learning pathway

+ +

Getting started with server-side programming is usually easier than client-side development, because dynamic websites tend to perform a lot of very similar operations (retrieving data from a database and displaying it in a page, validating user-entered data and saving it in a database, checking user permissions and logging users in, etc.), and are constructed using web frameworks that make these and other common web server operations easy.

+ +

Basic knowledge of programming concepts (or of a particular programming language) is useful, but not essential. Similarly, expertise in client-side coding is not required, but a basic knowledge will help you work better with the developers creating your client-side web "front end".

+ +

You will need to understand "how the web works". We recommend that you first read the following topics:

+ + + +

With that basic understanding, you'll be ready to work your way through the modules in this section. 

+ +

Modules

+ +

This topic contains the following modules. You should start with the first module, then go on to one of the following modules, which show how to work with two very popular server-side languages using appropriate web frameworks. 

+ +
+
Server-side website programming first steps
+
This module provides technology-agnostic information about server-side website programming such as "what is it?", "how does it differ from client-side programming?", and "why is it useful?". This module also outlines some of the more popular server-side web frameworks and gives guidance on how to select the best one for your site. Lastly, an introduction to web server security is provided.
+
Django Web Framework (Python)
+
Django is an extremely popular and fully featured server-side web framework, written in Python. The module explains why Django is such a good web server framework, how to set up a development environment and how to perform common tasks with it.
+
Express Web Framework (Node.js/JavaScript)
+
Express is a popular web framework, written in JavaScript and hosted within the node.js runtime environment. The module explains some of the key benefits of this framework, how to set up your development environment and how to perform common web development and deployment tasks.
+
+ +

See also

+ +
+
Node server without framework
+
This article provides a simple static file server built with pure Node.js, for those of you not wanting to use a framework.
+
diff --git a/files/hu/mdn/contribute/getting_started/index.html b/files/hu/mdn/contribute/getting_started/index.html new file mode 100644 index 0000000000..b137d56af4 --- /dev/null +++ b/files/hu/mdn/contribute/getting_started/index.html @@ -0,0 +1,101 @@ +--- +title: Ismerkedés az MDN-nel +slug: MDN/Contribute/Getting_started +translation_of: MDN/Contribute/Getting_started +--- +
{{MDNSidebar}}{{IncludeSubnav("/en-US/docs/MDN")}}
+ +

Mi egy nyílt, fejlesztőkből és szerkesztőkből álló csoport vagyunk, akik egy jobb webet tűztek ki maguk elé célul, márka-, böngésző-, és platformfüggetlenül. Bárki módosíthat az oldalon, és mindenki, aki megteszi, segít nekünk erősebbé válni. Együtt folytathatjuk a fejlesztést jobb, újabb ötletekkel, hogy még többet nyújthassunk. Itt kezdődik, veled.

+ +

Az MDN minden része (a weboldal felépítésétől a dokumentációkon keresztül a bemutatókig, szemléltetésekig) fejlesztők és szerkesztők, írók által lett létrehozva. Mindenki hozzá tud adni, és reméljük, Te is így teszel, tehát csatlakozol hozzánk!

+ +

Három egyszerű lépés az MDN használatához

+ +

Az MDN egy wiki, ahol bárki tud szerkeszteni és megjegyzést fűzni. Nem kell sem programozónak, sem tudósnak lenned. Rengeteg tennivaló van még, egyszerű feladatoktól a korrektúrázáson keresztül a komplex feladatokig (ide tartozik az API dokumentációk írása is)

+ +

A szerkesztés egyszerű és biztonságos. Ha hibázol, egyszerű javítani; ha egyszerűen nem vagy tisztában mindennel, vagy nem tökéletes a helyesírásod, ne aggódj! Van egy egész csoportunk, aki arra figyel, hogy ez az oldal minnél hitelesebb és minnél jobb legyen. Mindig lesz valaki, aki kijavítja az esetleges hibáidat, és kiszépíti a művedet. Oszd meg mindenkivel, amit tudsz, és bízz a tudásodban és a többiekben, akik segítenek, hogy jobban végezhesd a munkádat.

+ +

1. lépés: Regisztrálj az MDN-re

+ +

Hogy elkezdhesd itt a munkádat, szükséged van egy MDN fiókra. A részletekért lásd: Hogyan kell regisztrálni. Megjegyzendő, hogy mielőtt létrehozod a MDN fiókod, szükséged lesz egy GitHub fiókra, mivel a GitHub-ot használjuk azonosításra.

+ +

2. lépés: Válassz feladatot

+ +

Válassz feladattípust az alábbi {{anch("Possible task types", "listából")}}, és döntsd el, melyik illik a legjobban hozzád. Bármelyiket választhatod, és utána el is kezdheted a munkát.

+ +

3. lépés: Csináld is meg a feladatot

+ +

Miután eldöntötted, melyik típust szeretnéd, keress egy oldalt, kódrészletet, stb.. ami a témához kapcsolódik, és már szerkesztheted is.

+ +

Ne aggódj a tökéletesség miatt; más MDN szerkesztők itt vannak, hogy kijavítsák a hibákat, melyeken átsiklottál. Ha kérdésed van, menj a  Közösség oldalra információkért (levelezőlisták, csatornák, ahol választ találhatsz)

+ +
+

Fontos: Ha előbb inkább kísérleteznél, és nem élesben szerkesztenél, van egy homokozó nevű oldalunk számodra, ahol szabadon kísérletezhetsz. Kérlek, azért ne vidd túlzásba. A szükségtelen módosítások csak még több munkát okoznak számunkra.

+
+ +

Ha befejezted a feladatot, keress további feladatokat, melyeket tudsz csinálni.

+ +

Lehetséges feladattípusok

+ +

Sokféle úton tudsz nekünk segíteni, melyek persze függenek a képességeidtől, valamint az érdeklődésedtől. Bár néhány feladat ijesztő lehet, rengeteg egyszerű tevékenység is van. Néhány csak öt percet vesz igénybe. A feladat alatt meg fogod találni azt is, hogy nagyjából mennyi ideig tarthat a feladat általában.

+ +

1. lehetőség: A szavak kedvelője vagyok!

+ +

Ha az írás iránt érdeklődnél, segíthetsz átnézni és szerkeszteni a meglévő dokumentumainkat, és ki tudod javítani a hibákat benne

+ + + +
Megjegyzés: Ha átnézel egy cikket, vagy esetleg újat írsz, kérjük, hogy kukkants bele a stilizálással kapcsolatos segédletbe. Segíteni fog, hogy minél következetesebb cikkeket írj.
+ +

2. lehetőség: A kódért élek-halok

+ +

Szükségünk van kódrészletelre! Sőt, magát a weboldalunkat is (Kuma) segíthetnél fejleszteni!

+ + + +

3. lehetőség: Szöveg is - kód is

+ +

Vannak feladataink, melyeknél mindkét képességre szükség van, pl. új cikkek írása, technikai megjegyzések, vélemények, új dokumentációk.

+ + + +

4. lehetőség: Szeretném a saját nyelvemen olvasni az MDN-t

+ +

Minden fordítás önkéntesek által történik!

+ + + +

5. lehetőség: Hibát találtam, de nem tudom hogyan javítsam

+ +

Bejelentheted a hibát a hibabejelentő űrlap segítségével. (5 perc)

+ +

Egyéb teendők az MDN-en

+ + diff --git a/files/hu/mdn/contribute/index.html b/files/hu/mdn/contribute/index.html new file mode 100644 index 0000000000..d97707a7fe --- /dev/null +++ b/files/hu/mdn/contribute/index.html @@ -0,0 +1,21 @@ +--- +title: Közreműködés az MDN-en +slug: MDN/Contribute +tags: + - Guide + - Landing + - MDN Meta + - útmutató +translation_of: MDN/Contribute +--- +
{{MDNSidebar}}
{{IncludeSubnav("/hu/docs/MDN")}}
+ +

Üdvözöljük! Az oldal meglátogatásával megtette az első lépést, hogy az MDN közreműködője legyen.

+ +

Az itt található útmutatók lefedik az MDN-en közreműködés minden részét, beleértve a stílus útmutatókat, a szerkesztőnk és az eszközök útmutatóját, és így tovább. Kérjük, olvassa el (és tartsa be) a Mozilla feltételeit mielőtt bármilyen oldalt szerkesztene vagy létrehozna.

+ +

Ha eddig még nem működött közre az MDN-en, akkor a Kezdő lépések útmutató segíthet a feladat kiválasztásában.

+ +
 
+ +

{{LandingPageListSubPages()}}

diff --git a/files/hu/mdn/contribute/localize/index.html b/files/hu/mdn/contribute/localize/index.html new file mode 100644 index 0000000000..30e05134b4 --- /dev/null +++ b/files/hu/mdn/contribute/localize/index.html @@ -0,0 +1,45 @@ +--- +title: Localizing MDN +slug: MDN/Contribute/Localize +tags: + - Landing + - Localization + - MDN Meta + - l10n +translation_of: MDN/Contribute/Localize +--- +
{{MDNSidebar}}
+
+
{{IncludeSubnav("/hu-HU/docs/MDN")}}
+ +

Az MDN-t a világ minden táján használják, a webes technológiák - és a Firefox belső működésének - referenciájaként és útmutatójaként. A honosítási közösségek kulcsfontosságú részei a Mozilla projektnek; a dokumentációkon végzett fordítási és honosítási munkájuk segít a nyílt web fejlesztésében, világszerte. Ha szeretne többet megtudni a honosításról, vagy új honosításba kezdene, ez az a hely, ahol nekiláthat.

+ +

{{LandingPageListSubpages}}

+ +

Honosító közösségek az MDN-en

+ +

Az MDN-en zajló honosítási tevékenységeket független fordítók, és együttműködő csoportok végzik, sokszor egy nagyobb Mozilla honosító közösség részeként. A honosítási projekteket Honosítási vezetők vezetik.

+ + + +

Honosítási eszközök

+ +

Létezik néhány hasznos eszköz, melyet a honosítás során használhat:

+ +
+
Pontoon
+
A karakterláncok fordítására használt, különböző Mozilla projekteknél, beleértve az MDN felhasználói felületét (valamint a Firefox felhasználói felületét is).
+
Transvision
+
Egy segédprogram a franciországi Mozillától, amellyel angol karakteláncokra lehet keresni különféle Mozilla kódokban a kiválasztott célnyelv fordításainak megkeresésére. Hasznos az előnyben részesített fordított szavak és kifejezések megtalálásában.
+
+ +

Lásd még

+ + +
+
diff --git "a/files/hu/mdn/contribute/localize/oldalak_ford\303\255t\303\241sa/index.html" "b/files/hu/mdn/contribute/localize/oldalak_ford\303\255t\303\241sa/index.html" new file mode 100644 index 0000000000..32af636546 --- /dev/null +++ "b/files/hu/mdn/contribute/localize/oldalak_ford\303\255t\303\241sa/index.html" @@ -0,0 +1,56 @@ +--- +title: MDN oldalak fordítása +slug: MDN/Contribute/Localize/Oldalak_fordítása +tags: + - MDN Meta + - fordítás + - honosítás + - l10n + - útmutató +translation_of: MDN/Contribute/Localize/Translating_pages +--- +
{{MDNSidebar}}
+ +

Ez a cikk egy alapvető útmutató az MDN-en található tartalom fordításához, amely tartalmazza a fordítási munka menetét, és tanácsokat ad a különböző tartalmak helyes kezeléséhez.

+ +

Új oldal fordításának elkezdése

+ +

Amikor egy olyan oldallal találkozol, amelyet szeretnél lefordítani a nyelvedre, akkor kövesd ezeket a lépéseket:

+ +
    +
  1. Kattints a Nyelvek ikonra a Nyelvek menü megnyitásához, és kattints a Fordítás hozzáadása gombra. Ekkor megjelenik a Nyelvválasztó oldal.
  2. +
  3. Válaszd ki a nyelvet, amelyre le akarod fordítani az oldalt. Megjelenik a Cikk fordítása nézet, az eredeti nyelvi szöveggel a bal oldalon.
  4. +
  5. A Fordítás leírása alatt lefordíthatod a címet, és választhatóan, a cikk SEO URL-jét az adott nyelven. A SEO URL az oldal URL-jének a vége (például az „Oldalak_fordítása” ennél a cikknél.) Néhány nyelvi közösség nem fordítja ezt le, ugyanúgy hagyva mint az angolt. Hasonlítsd össze a többi cikket a nyelveden, és határozd meg, hogy mi a bevett gyakorlat. Rákattinthatsz a mínusz jelre a Fordítás leírása mellett az információ elrejtéséhez, ha már végeztél vele, hogy több hely maradjon a Tartalom fordítása résznek.
  6. +
  7. A Tartalom fordítása alatt fordítsd le az oldal törzsét.
  8. +
  9. Tölts ki legalább egy címkét az oldalhoz
  10. +
  11. Kattints a Változtatások mentése gombra ha végeztél.
  12. +
+ +
Megjegyzés: A Cikk fordítása nézet felhasználói felületi elemei először angolul jelennek meg. A későbbi felkeresésekkor a megfelelő nyelven fog megjelenni az oldal, ha létezik honosítás az MDN-en ahhoz a nyelvhez. Az MDN felhasználói felülete a Pontoon segítségével honosítható. Nézd meg a Honosítás a Pontoonnal oldalt az eszköz használatának részleteiért.
+ +

Lefordított oldalak szerkesztése

+ + + +

Ha az angol verzió megváltozott mióta a fordítást legutóbb frissítettek, akkor a Cikk fordítása nézet megjeleníti a forrás szintű „diff”-et az angol nyelvű verzióban. Ez segít abban, hogy eldöntsd mit kell frissíteni a fordításban.

+ +

Fordítások címkézése

+ +

Fontos, hogy minden oldal meg legyen címkézve legalább egy címkével. Akkor is, ha ez egy fordítás.

+ +

Néhány címke keresési szűrőként használt, vagy közreműködők közti közmegegyezésként. Ezeket nem kell lefordítani. Ezen címkék megismeréséhez olvasd el a címkézési szabványokat. Nyugodtan létrehozhatsz lefordított címkéket is az olyan tartalmak csoportosításához, melyeket nem fed le egy szabványos címke.

+ + + +

Tippek új honosítóknak

+ +

Ha új vagy az MDN honosításában, akkor itt van néhány javaslat:

+ + diff --git a/files/hu/mdn/index.html b/files/hu/mdn/index.html new file mode 100644 index 0000000000..bad49ae770 --- /dev/null +++ b/files/hu/mdn/index.html @@ -0,0 +1,30 @@ +--- +title: Az MDN projekt +slug: MDN +tags: + - Kezdőoldal + - MDN +translation_of: MDN +--- +
{{MDNSidebar}}
+ +

A Mozilla fejlesztői hálózat (MDN) egy wiki, amelyen a webet, Mozilla technológiákat, a Firefox OS-t, és más fejlesztői témákat dokumentálunk. Bárki bővítheti és szerkesztheti a tartalmat. Nem kell programozónak lennie, vagy sokat tudnia a technológiáról; sok különféle elvégzendő feladat van, az egyszerűtől kezdve (átolvasás, elütések javítása) az összetettig (API dokumentáció írása).

+ +
+

Az MDN projekt célja a nyílt web, a Mozilla technológiák és Mozilla projektek dokumentálása. Meghívjuk, hogy segítsen!

+
+ +

Szükségünk van a segítségére! Könnyű dolga lesz. Ne aggódjon az engedélyek kérése vagy az elkövetett hibák miatt. Emellett ismerje meg az MDN közösséget; azért vagyunk itt, hogy segítsünk! A lenti dokumentáció elég lesz az elinduláshoz, de nyugodtan csatlakozhat a társalgáshoz az MDN Web Docs csatornán is.

+ + diff --git a/files/hu/mozilla/bugzilla/index.html b/files/hu/mozilla/bugzilla/index.html new file mode 100644 index 0000000000..f9a6703385 --- /dev/null +++ b/files/hu/mozilla/bugzilla/index.html @@ -0,0 +1,67 @@ +--- +title: Bugzilla +slug: Mozilla/Bugzilla +tags: + - Bugzilla + - Developing Mozilla + - 'Developing_Mozilla:Tools' + - NeedsTranslation + - QA + - Tools + - TopicStub +translation_of: Mozilla/Bugzilla +--- +

A bugzilla.mozilla.org (gyakran rövidítve a bmo) a Mozilla.org hibakövetési rendszere, egy adatbázis a hibák rögzítésére és a Firefox, Thunderbird, SeaMonkey, Camino és más mozilla.org projektek fejlesztési kérelmeire.

+ +
+
+

Dokumentáció a Bmo-ról

+ +
+
Mit kell csinálni, és mit nem csinálni Bugzilában
+
Tippek a Bugzilla használatához, valamint a kerülendő dolgok.
+
Bugzilla-etikett
+
Útmutató az etiketthez; Ez az útmutató segít megérteni, hogyan lehet a legjobban viselkedni a bmo-n, és hogy a megfelelő viselkedés és az udvariasság használata elősegíti, hogy a problémád mielőbb, se később megoldódjon.
+
Hogyan tudom megtudni, ha hibát már jelentettek
+
Hasznos (de nem kötelező), ha ellenőrizni szeretné, hogy a jelentett probléma már nyomon volt-e. Ez az útmutató segít abban.
+
Minőségbiztosítás
+
Dokumentáció a Mozilla minőségbiztosításáról.
+
Hibaírási útmutató
+
Útmutató egy jó, érthető hiba elkészítéséhez, amelyet a fejlesztői csapat könnyen követ.
+
Hogyan kell beküldeni a javítást
+
Ha kijavított egy hibát, vagy új funkciót hajtott végre, akkor be kell helyeznie a javítást a fába, hogy ez a termék részévé váljon. Ez az útmutató megtanítja, hogyan!
+
+ +

Összes megtekintése...

+
+ +
+

Segítség a közösségtől

+ +

Segítségre van szüksége egy CSS-rel kapcsolatos problémában, és nem talál megoldást a dokumentációban?

+ + + +

Ne felejtsd el a nettikettet ...

+ + + + + +

Eszközök

+ +
    +
  • A Bugzilla Todos felsorolja az áttekintési és megjelölési kérelmeket, a bejelentkezési javításokat, a másoktól nem teljesített kéréseket és a hozzárendelt hibákat.
  • +
+
+
diff --git a/files/hu/mozilla/gecko/index.html b/files/hu/mozilla/gecko/index.html new file mode 100644 index 0000000000..fee760a09e --- /dev/null +++ b/files/hu/mozilla/gecko/index.html @@ -0,0 +1,64 @@ +--- +title: Gecko +slug: Mozilla/Gecko +tags: + - Gecko + - Mozilla +translation_of: Mozilla/Gecko +--- +
{{FirefoxSidebar}}
+ +

A Gecko a Mozilla Projekt keretében fejlesztett böngészőmotor. Az eredeti neve NGLayout volt. A Gecko feladata a webes tartalom (például HTML, CSS, XUL és JavaScript) feldolgozása és megjelenítése a felhasználó képernyőjén vagy nyomtatásban. A XUL-alapú alkalmazásokban a Gecko felel az alkalmazás felhasználói felületének megjelenítéséért is.

+ +

A Geckót számos alkalmazásban használják, többek között néhány böngészőben, pl. a Firefox és a SeaMonkeyban is (teljesebb listát lásd a Wikipédia Geckóról szóló szócikkében). A Gecko azonos verzióját használó termékek azonos mértékben támogatják a webes sztenderdeket.

+ + + + + + + + +
+

Dokumentáció

+ +
+
Chrome
+
This page contains information specific to browser chrome (not Google Chrome) code running in Gecko.
+
Gecko GYIK
+
Gyakran ismételt kérdések a Geckóról.
+
Gecko DOM referencia
+
A DOM referenciaszintű leírása.
+
Gecko-esemény-referencia
+
Referencia a Geckóban és Mozilla-alkalmazásokban használt eseményekről; a webes sztenderdek által meghatározott DOM-eseményekhez lásd a DOM-esemény-referenciát.
+
Gecko- és alkalmazásverziók
+
A Gecko verziói és az azokat használó alkalmazások.
+
Bevezetés a megjelenésbe a Mozillában
+
Tech Talk on layout.
+
Mozilla beágyazása
+
A Gecko használata saját alkalmazásban.
+
A Gecko által támogatott karakterkészletek
+
A Gecko által támogatott karakterkészletek listája.
+
Többszálú HTML-feldolgozás
+
A HTML-feldolgozó többszálú működésének leírása.
+
{{interwiki('wikimo', 'Gecko:Home_Page', 'Gecko-kezdőlap a MozillaWikiben')}}
+
Home for the active developers. Roadmaps and more up-to-date resources.
+
+ +

Minden kapcsolódó dokumentáció megjelenítése

+
+

Közösség

+ +
    +
  • Mozilla-fórumok: {{DiscussionList("dev-tech-layout", "mozilla.dev.tech.layout")}}
  • +
+ +

Kapcsolódó témák

+ + +
diff --git a/files/hu/mozilla/index.html b/files/hu/mozilla/index.html new file mode 100644 index 0000000000..e24ed8a774 --- /dev/null +++ b/files/hu/mozilla/index.html @@ -0,0 +1,13 @@ +--- +title: Mozilla +slug: Mozilla +tags: + - NeedsTranslation + - TopicStub +translation_of: Mozilla +--- +
+ {{draft}}
+

This will soon be an awesome landing page for Mozilla internals. For now, it's not.

+
+ {{ListSubpages}}
diff --git a/files/hu/tools/index.html b/files/hu/tools/index.html new file mode 100644 index 0000000000..fc51d30559 --- /dev/null +++ b/files/hu/tools/index.html @@ -0,0 +1,218 @@ +--- +title: Firefox Developer Tools +slug: Tools +tags: + - Developing Mozilla + - Guide + - NeedsMarkupWork + - NeedsTranslation + - Tools + - TopicStub + - Web Development + - 'Web Development:Tools' +translation_of: Tools +--- +
{{ToolsSidebar}}
+ +

Examine, edit, and debug HTML, CSS, and JavaScript on the desktop and on mobile.

+ +

If you are looking for information on using the web developer tools available in Firefox, you've come to the right place — this page provides links to detailed information on all of the core tools and additional tools, and further information such as how to connect to and debug Firefox for Android, how to extend the devtools, and how to debug the browser as a whole.

+ +

Please explore the links found in the sidebar, and further down the page. If you have any feedback or questions about the devtools, send us messages on our mailing list or IRC channel (see the community links near the bottom of the page). If you have any feedback or questions specifically about the documentation, the MDN discourse is a good place to post.

+ +
+

Note: If you are just getting started with web development and using developer tools, our learning web development docs will help you — see Getting started with the Web and What are browser developer tools? for good starting points.

+
+ +

The Core Tools

+ +

You can open the Firefox Developer Tools from the menu by selecting Tools > Web Developer > Toggle Tools or use the keyboard shortcut Ctrl + Shift + I or F12 on Windows and Linux, or Cmd + Opt + I on macOS.

+ +

The ellipsis menu on the right-hand side of Developer Tools, contains several commands that let you perform actions or change tool settings.

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + +
This button only appears when there are multiple iframes on a page. Click it to display a list of the iframes on the current page and select the one with which you want to work.
Click this button to take a screenshot of the current page. (Note: This feature is not turned on by default and must be enabled in settings before the icon will appear.)
Toggles Responsive Design Mode.
Opens the menu that includes docking options, the ability to show or hide the split console, and Developer Tools settings. The menu also includes links to the documentation for Firefox Web Tools and the Mozilla Community.
Closes the Developer Tools
+ +
+
+

Page Inspector

+ +

The all-new Inspector panel in Firefox 57.

+ +

View and edit page content and layout. Visualise many aspects of the page including the box model, animations, and grid layouts.

+
+ +
+

Web Console

+ +

The all-new Console in Firefox 57.

+ +

See messages logged by a web page and interact with the page using JavaScript.

+
+
+ +
+
+

JavaScript Debugger

+ +

The all-new Firefox 57 Debugger.html

+ +

Stop, step through, examine, and modify the JavaScript running in a page.

+
+ +
+

Network Monitor

+ +

The Network panel in Firefox 57 DevTools.

+ +

See the network requests made when a page is loaded.

+
+
+ +
+
+

Performance Tools

+ +

Performance Tools in Firefox 57 Developer Tools

+ +

Analyze your site's general responsiveness, JavaScript, and layout performance.

+
+ +
+

Responsive Design Mode

+ +

Responsive Design mode in Firefox 57.

+ +

See how your website or app will look and behave on different devices and network types.

+
+
+ +
+
+

Accessibility inspector

+ +

Performance Tools in Firefox 57 Developer Tools

+ +

Provides a means to access the page's accessibility tree, allowing you to check what's missing or otherwise needs attention.

+
+ +
+
+ +
+

Note: The collective term for the UI inside which the DevTools all live is the Toolbox.

+
+ +

More Tools

+ +

These developer tools are also built into Firefox. Unlike the "Core Tools" above, you might not use them every day.

+ +
+
+
Memory
+
Figure out which objects are keeping memory in use.
+
Storage Inspector
+
Inspect cookies, local storage, indexedDB, and session storage present in a page.
+
DOM Property Viewer
+
Inspect the page's DOM properties, functions, etc.
+
Eyedropper
+
Select a color from the page.
+
Scratchpad
+
A text editor built into Firefox that lets you write and execute JavaScript.
+
Style Editor
+
View and edit CSS styles for the current page.
+
Taking screenshots
+
Take a screenshot of the entire page or of a single element.
+
Measure a portion of the page
+
Measure a specific area of a web page.
+
Rulers
+
Overlay horizontal and vertical rulers on a web page
+
+
+ +
+
+

+ +

For the latest developer tools and features, try Firefox Developer Edition.

+ +

Download Firefox Developer Edition

+
+ +
+
+ +

Connecting the Developer Tools

+ +

If you open the developer tools using keyboard shortcuts or the equivalent menu items, they'll target the document hosted by the currently active tab. But you can attach the tools to a variety of other targets, too, both within the current browser and in different browsers or even different devices.

+ +
+
+
about:debugging
+
Debug add-ons, content tabs, and workers running in the browser.
+
Connecting to Firefox for Android
+
Connect the developer tools to an instance of Firefox running on an Android device.
+
Connecting to iframes
+
Connect the developer tools to a specific iframe in the current page.
+
Connecting to other browsers
+
Connect the developer tools to Chrome on Android and Safari on iOS.
+
+
+ +

Debugging the browser

+ +

By default, the developer tools are attached to a web page or web app. But you can also connect them to the browser as a whole. This is useful for browser and add-on development.

+ +
+
+
Browser Console
+
See messages logged by the browser itself and by add-ons, and run JavaScript code in the browser's scope.
+
Browser Toolbox
+
Attach the Developer Tools to the browser itself.
+
+
+ +

Extending the devtools

+ +

For information on extending the Firefox DevTools, see Extending the developer tools over in the Browser Extensions section of MDN.

+ +

Migrating from Firebug

+ +

Firebug has come to the end of its lifespan (see Firebug lives on in Firefox DevTools for details of why), and we appreciate that some people will find migrating to another less familiar set of DevTools to be challenging. To ease a transition from Firebug to the Firefox developer tools, we have written a handy guide — Migrating from Firebug.

+ +

Contribute

+ +

If you want to help improve the developer tools, these resources will get you started.

+ +
+
+
Get Involved
+
Our developer documentation explains how to get involved.
+
bugs.firefox-dev.tools
+
A tool helping to find bugs to work on.
+
+
diff --git a/files/hu/web/api/document/createtextnode/index.html b/files/hu/web/api/document/createtextnode/index.html new file mode 100644 index 0000000000..6fc2489f34 --- /dev/null +++ b/files/hu/web/api/document/createtextnode/index.html @@ -0,0 +1,82 @@ +--- +title: Document.createTextNode() +slug: Web/API/Document/createTextNode +tags: + - API + - DOM + - Document + - Method + - Reference + - Szöveg + - creatTextNode +translation_of: Web/API/Document/createTextNode +--- +
{{APIRef("DOM")}}
+ +

Készít egy új {{domxref("Text")}} node-ot. Ezt a metódust használhatod arra hogy escape-eld a HTML karaktereket a szövegből, mint pl "<" vagy "&"

+ +

Syntax

+ +
var textNode = document.createTextNode(text);
+
+ + + +

Példa

+ +
<!DOCTYPE html>
+<html lang="en">
+<head>
+<title>createTextNode example</title>
+<script>
+function addTextNode(text) {
+  var newtext = document.createTextNode(text),
+      p1 = document.getElementById("p1");
+
+  p1.appendChild(newtext);
+}
+</script>
+</head>
+
+<body>
+  <button onclick="addTextNode('IGEN! ');">IGEN!</button>
+  <button onclick="addTextNode('NEM! ');">NEM!</button>
+  <button onclick="addTextNode('ESCAPE <strong>BOLD</strong> AND &bull; ENTITIES! ');">ESCAPE <strong>BOLD</strong> AND &bull; ENTITIES!</button>
+
+  <hr />
+
+  <p id="p1">First line of paragraph.</p>
+</body>
+</html>
+
+
+ +

{{EmbedLiveSample('Example')}}

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-document-createtextnode', 'Document: createTextNode')}}{{Spec2('DOM WHATWG')}}
+ +

Browser compatibility

+ + + +

{{Compat("api.Document.createTextNode")}}

diff --git a/files/hu/web/api/document/index.html b/files/hu/web/api/document/index.html new file mode 100644 index 0000000000..a8181b06b7 --- /dev/null +++ b/files/hu/web/api/document/index.html @@ -0,0 +1,665 @@ +--- +title: Document +slug: Web/API/Document +tags: + - API + - DOM + - Document + - Interface + - NeedsTranslation + - Reference + - TopicStub +translation_of: Web/API/Document +--- +
{{APIRef("DOM")}}
+ +

The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. The DOM tree includes elements such as {{HTMLElement("body")}} and {{HTMLElement("table")}}, among many others. It provides functionality globally to the document, like how to obtain the page's URL and create new elements in the document.

+ +

{{InheritanceDiagram}}

+ +

The Document interface describes the common properties and methods for any kind of document. Depending on the document's type (e.g. HTML, XML, SVG, …), a larger API is available: HTML documents, served with the "text/html" content type, also implement the {{DOMxRef("HTMLDocument")}} interface, whereas XML and SVG documents implement the {{DOMxRef("XMLDocument")}} interface.

+ +

Constructor

+ +
+
{{DOMxRef("Document.Document", "Document()")}}
+
Creates a new Document object.
+
+ +

Properties

+ +

This interface also inherits from the {{DOMxRef("Node")}} and {{DOMxRef("EventTarget")}} interfaces.

+ +
+
{{DOMxRef("Document.anchors")}}{{ReadOnlyInline}}
+
Returns a list of all of the anchors in the document.
+
{{DOMxRef("Document.body")}}
+
Returns the {{HTMLElement("body")}} or {{htmlelement("frameset")}} node of the current document.
+
{{DOMxRef("Document.characterSet")}}{{ReadOnlyInline}}
+
Returns the character set being used by the document.
+
{{DOMxRef("Document.compatMode")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
Indicates whether the document is rendered in quirks or strict mode.
+
{{DOMxRef("Document.contentType")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
Returns the Content-Type from the MIME Header of the current document.
+
{{DOMxRef("Document.doctype")}}{{ReadOnlyInline}}
+
Returns the Document Type Definition (DTD) of the current document.
+
{{DOMxRef("Document.documentElement")}}{{ReadOnlyInline}}
+
Returns the {{DOMxRef("Element")}} that is a direct child of the document. For HTML documents, this is normally the {{DOMxRef("HTMLHtmlElement")}} object representing the document's {{HTMLElement("html")}} element.
+
{{DOMxRef("Document.documentURI")}}{{ReadOnlyInline}}
+
Returns the document location as a string.
+
{{DOMxRef("Document.embeds")}}{{ReadOnlyInline}}
+
Returns a list of the embedded {{HTMLElement('embed')}} elements within the current document.
+
{{DOMxRef("Document.fonts")}}
+
Returns the {{DOMxRef("FontFaceSet")}} interface of the current document.
+
{{DOMxRef("Document.forms")}}{{ReadOnlyInline}}
+
Returns a list of the {{HTMLElement("form")}} elements within the current document.
+
{{DOMxRef("Document.head")}}{{ReadOnlyInline}}
+
Returns the {{HTMLElement("head")}} element of the current document.
+
{{DOMxRef("Document.hidden")}}{{ReadOnlyInline}}
+
Returns a Boolean value indicating if the page is considered hidden or not.
+
{{DOMxRef("Document.images")}}{{ReadOnlyInline}}
+
Returns a list of the images in the current document.
+
{{DOMxRef("Document.implementation")}}{{ReadOnlyInline}}
+
Returns the DOM implementation associated with the current document.
+
{{DOMxRef("Document.lastStyleSheetSet")}}{{ReadOnlyInline}}
+
Returns the name of the style sheet set that was last enabled. Has the value null until the style sheet is changed by setting the value of {{DOMxRef("Document.selectedStyleSheetSet","selectedStyleSheetSet")}}.
+
{{DOMxRef("Document.links")}}{{ReadOnlyInline}}
+
Returns a list of all the hyperlinks in the document.
+
{{DOMxRef("Document.mozSyntheticDocument")}} {{Non-standard_Inline}}
+
Returns a {{JSxRef("Boolean")}} that is true only if this document is synthetic, such as a standalone image, video, audio file, or the like.
+
{{DOMxRef("Document.plugins")}}{{ReadOnlyInline}}
+
Returns a list of the available plugins.
+
{{DOMxRef("Document.featurePolicy")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
Returns the {{DOMxRef("FeaturePolicy")}} interface which provides a simple API for introspecting the feature policies applied to a specific document.
+
{{DOMxRef("Document.preferredStyleSheetSet")}}{{ReadOnlyInline}}
+
Returns the preferred style sheet set as specified by the page author.
+
{{DOMxRef("Document.scripts")}}{{ReadOnlyInline}}
+
Returns all the {{HTMLElement("script")}} elements on the document.
+
{{DOMxRef("Document.scrollingElement")}}{{ReadOnlyInline}}
+
Returns a reference to the {{DOMxRef("Element")}} that scrolls the document.
+
{{DOMxRef("Document.selectedStyleSheetSet")}}
+
Returns which style sheet set is currently in use.
+
{{DOMxRef("Document.styleSheetSets")}}{{ReadOnlyInline}}
+
Returns a list of the style sheet sets available on the document.
+
{{DOMxRef("Document.timeline")}}{{ReadOnlyInline}}
+
Returns timeline as a special instance of {{domxref("DocumentTimeline")}} that is automatically created on page load.
+
{{DOMxRef("Document.undoManager")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
+
{{DOMxRef("Document.visibilityState")}}{{ReadOnlyInline}}
+
Returns a string denoting the visibility state of the document. Possible values are visible, hidden, prerender, and unloaded.
+
+ +

The Document interface is extended with the {{DOMxRef("ParentNode")}} interface:

+ +

{{page("/en-US/docs/Web/API/ParentNode","Properties")}}

+ +

Extensions for HTMLDocument

+ +

The Document interface for HTML documents inherits from the {{DOMxRef("HTMLDocument")}} interface or, since HTML5, is extended for such documents.

+ +
+
{{DOMxRef("Document.cookie")}}
+
Returns a semicolon-separated list of the cookies for that document or sets a single cookie.
+
{{DOMxRef("Document.defaultView")}}{{ReadOnlyInline}}
+
Returns a reference to the window object.
+
{{DOMxRef("Document.designMode")}}
+
Gets/sets the ability to edit the whole document.
+
{{DOMxRef("Document.dir")}}{{ReadOnlyInline}}
+
Gets/sets directionality (rtl/ltr) of the document.
+
{{DOMxRef("Document.domain")}}
+
Gets/sets the domain of the current document.
+
{{DOMxRef("Document.lastModified")}}{{ReadOnlyInline}}
+
Returns the date on which the document was last modified.
+
{{DOMxRef("Document.location")}}{{ReadOnlyInline}}
+
Returns the URI of the current document.
+
{{DOMxRef("Document.readyState")}}{{ReadOnlyInline}}
+
Returns loading status of the document.
+
{{DOMxRef("Document.referrer")}}{{ReadOnlyInline}}
+
Returns the URI of the page that linked to this page.
+
{{DOMxRef("Document.title")}}
+
Sets or gets the title of the current document.
+
{{DOMxRef("Document.URL")}}{{ReadOnlyInline}}
+
Returns the document location as a string.
+
+ +

Properties included from DocumentOrShadowRoot

+ +

The Document interface includes the following properties defined on the {{DOMxRef("DocumentOrShadowRoot")}} mixin. Note that this is currently only implemented by Chrome; other browsers still implement them directly on the {{DOMxRef("Document")}} interface.

+ +
+
{{DOMxRef("DocumentOrShadowRoot.activeElement")}}{{ReadOnlyInline}}
+
Returns the {{DOMxRef('Element')}} within the shadow tree that has focus.
+
{{DOMxRef("Document.fullscreenElement")}}{{ReadOnlyInline}}
+
The element that's currently in full screen mode for this document.
+
{{DOMxRef("DocumentOrShadowRoot.pointerLockElement")}} {{Experimental_Inline}}{{ReadOnlyInline}}
+
Returns the element set as the target for mouse events while the pointer is locked. null if lock is pending, pointer is unlocked, or if the target is in another document.
+
{{DOMxRef("DocumentOrShadowRoot.styleSheets")}}{{ReadOnlyInline}}
+
Returns a {{DOMxRef('StyleSheetList')}} of {{DOMxRef('CSSStyleSheet')}} objects for stylesheets explicitly linked into, or embedded in a document.
+
+ +

Event handlers

+ +
+
{{DOMxRef("Document.onafterscriptexecute")}} {{Non-standard_Inline}}
+
Represents the event handling code for the {{event("afterscriptexecute")}} event.
+
{{DOMxRef("Document.onbeforescriptexecute")}} {{Non-standard_Inline}}
+
Represents the event handling code for the {{event("beforescriptexecute")}} event.
+
{{DOMxRef("Document.oncopy")}} {{Non-standard_Inline}}
+
Represents the event handling code for the {{event("copy")}} event.
+
{{DOMxRef("Document.oncut")}} {{Non-standard_Inline}}
+
Represents the event handling code for the {{event("cut")}} event.
+
{{DOMxRef("Document.onfullscreenchange")}}
+
Is an {{DOMxRef("EventHandler")}} representing the code to be called when the {{event("fullscreenchange")}} event is raised.
+
{{DOMxRef("Document.onfullscreenerror")}}
+
Is an {{DOMxRef("EventHandler")}} representing the code to be called when the {{event("fullscreenerror")}} event is raised.
+
{{DOMxRef("Document.onpaste")}} {{Non-standard_Inline}}
+
Represents the event handling code for the {{event("paste")}} event.
+
{{DOMxRef("Document.onreadystatechange")}}
+
Represents the event handling code for the {{event("readystatechange")}} event.
+
{{DOMxRef("Document.onselectionchange")}} {{Experimental_Inline}}
+
Is an {{DOMxRef("EventHandler")}} representing the code to be called when the {{event("selectionchange")}} event is raised.
+
{{DOMxRef("Document.onvisibilitychange")}}
+
Is an {{DOMxRef("EventHandler")}} representing the code to be called when the {{event("visibilitychange")}} event is raised.
+
+ +

The Document interface is extended with the {{DOMxRef("GlobalEventHandlers")}} interface:

+ +

{{Page("/en-US/docs/Web/API/GlobalEventHandlers", "Properties")}}

+ +

Deprecated properties

+ +
+
{{DOMxRef("Document.alinkColor")}} {{Deprecated_Inline}}
+
Returns or sets the color of active links in the document body.
+
{{DOMxRef("Document.all")}} {{Deprecated_Inline}} {{Non-standard_Inline}}
+
Provides access to all elements in the document — it returns an {{DOMxRef('HTMLAllCollection')}} rooted at the document node. This is a legacy, non-standard property and should not be used.
+
{{DOMxRef("Document.applets")}} {{Deprecated_Inline}}{{ReadOnlyInline}}
+
Returns an ordered list of the applets within a document.
+
{{DOMxRef("Document.bgColor")}} {{Deprecated_Inline}}
+
Gets/sets the background color of the current document.
+
{{DOMxRef("Document.charset")}} {{Deprecated_Inline}}{{ReadOnlyInline}}
+
Alias of {{DOMxRef("Document.characterSet")}}. Use this property instead.
+
{{DOMxRef("Document.domConfig")}} {{Deprecated_Inline}}
+
Should return a {{DOMxRef("DOMConfiguration")}} object.
+
{{DOMxRef("Document.fgColor")}} {{Deprecated_Inline}}
+
Gets/sets the foreground color, or text color, of the current document.
+
{{DOMxRef("Document.fullscreen")}} {{Obsolete_Inline}}
+
true when the document is in {{DOMxRef("Using_full-screen_mode","full-screen mode")}}.
+
{{DOMxRef("Document.height")}} {{Non-standard_Inline}} {{Obsolete_Inline}}
+
Gets/sets the height of the current document.
+
{{DOMxRef("Document.inputEncoding")}} {{Deprecated_Inline}}{{ReadOnlyInline}}
+
Alias of {{DOMxRef("Document.characterSet")}}. Use this property instead.
+
{{DOMxRef("Document.linkColor")}} {{Deprecated_Inline}}
+
Gets/sets the color of hyperlinks in the document.
+
{{DOMxRef("Document.vlinkColor")}} {{Deprecated_Inline}}
+
Gets/sets the color of visited hyperlinks.
+
{{DOMxRef("Document.width")}} {{Non-standard_Inline}} {{Obsolete_Inline}}
+
Returns the width of the current document.
+
{{DOMxRef("Document.xmlEncoding")}} {{Deprecated_Inline}}
+
Returns the encoding as determined by the XML declaration.
+
{{DOMxRef("Document.xmlStandalone")}} {{Obsolete_Inline("Gecko10")}}
+
Returns true if the XML declaration specifies the document to be standalone (e.g., An external part of the DTD affects the document's content), else false.
+
{{DOMxRef("Document.xmlVersion")}} {{Obsolete_Inline("Gecko10")}}
+
Returns the version number as specified in the XML declaration or "1.0" if the declaration is absent.
+
+ +

Methods

+ +

This interface also inherits from the {{DOMxRef("Node")}} and {{DOMxRef("EventTarget")}} interfaces.

+ +
+
{{DOMxRef("Document.adoptNode()")}}
+
Adopt node from an external document.
+
{{DOMxRef("Document.captureEvents()")}} {{Deprecated_Inline}}
+
See {{DOMxRef("Window.captureEvents")}}.
+
{{DOMxRef("Document.caretRangeFromPoint()")}} {{Non-standard_Inline}}
+
Gets a {{DOMxRef("Range")}} object for the document fragment under the specified coordinates.
+
{{DOMxRef("Document.createAttribute()")}}
+
Creates a new {{DOMxRef("Attr")}} object and returns it.
+
{{DOMxRef("Document.createAttributeNS()")}}
+
Creates a new attribute node in a given namespace and returns it.
+
{{DOMxRef("Document.createCDATASection()")}}
+
Creates a new CDATA node and returns it.
+
{{DOMxRef("Document.createComment()")}}
+
Creates a new comment node and returns it.
+
{{DOMxRef("Document.createDocumentFragment()")}}
+
Creates a new document fragment.
+
{{DOMxRef("Document.createElement()")}}
+
Creates a new element with the given tag name.
+
{{DOMxRef("Document.createElementNS()")}}
+
Creates a new element with the given tag name and namespace URI.
+
{{DOMxRef("Document.createEntityReference()")}} {{Obsolete_Inline}}
+
Creates a new entity reference object and returns it.
+
{{DOMxRef("Document.createEvent()")}}
+
Creates an event object.
+
{{DOMxRef("Document.createNodeIterator()")}}
+
Creates a {{DOMxRef("NodeIterator")}} object.
+
{{DOMxRef("Document.createProcessingInstruction()")}}
+
Creates a new {{DOMxRef("ProcessingInstruction")}} object.
+
{{DOMxRef("Document.createRange()")}}
+
Creates a {{DOMxRef("Range")}} object.
+
{{DOMxRef("Document.createTextNode()")}}
+
Creates a text node.
+
{{DOMxRef("Document.createTouch()")}} {{Deprecated_Inline}}
+
Creates a {{DOMxRef("Touch")}} object.
+
{{DOMxRef("Document.createTouchList()")}}
+
Creates a {{DOMxRef("TouchList")}} object.
+
{{DOMxRef("Document.createTreeWalker()")}}
+
Creates a {{DOMxRef("TreeWalker")}} object.
+
{{DOMxRef("Document.enableStyleSheetsForSet()")}}
+
Enables the style sheets for the specified style sheet set.
+
{{DOMxRef("Document.exitPointerLock()")}} {{Experimental_Inline}}
+
Release the pointer lock.
+
{{DOMxRef("Document.getAnimations()")}} {{Experimental_Inline}}
+
Returns an array of all {{DOMxRef("Animation")}} objects currently in effect, whose target elements are descendants of the document.
+
{{DOMxRef("Document.getElementsByClassName()")}}
+
Returns a list of elements with the given class name.
+
{{DOMxRef("Document.getElementsByTagName()")}}
+
Returns a list of elements with the given tag name.
+
{{DOMxRef("Document.getElementsByTagNameNS()")}}
+
Returns a list of elements with the given tag name and namespace.
+
{{DOMxRef("Document.hasStorageAccess()")}}
+
Returns a {{jsxref("Promise")}} that resolves with a boolean value indicating whether the document has access to its first-party storage.
+
{{DOMxRef("Document.importNode()")}}
+
Returns a clone of a node from an external document.
+
{{DOMxRef("Document.normalizeDocument()")}} {{Obsolete_Inline}}
+
Replaces entities, normalizes text nodes, etc.
+
{{DOMxRef("Document.releaseCapture()")}} {{Non-standard_Inline}} {{gecko_minversion_inline("2.0")}}
+
Releases the current mouse capture if it's on an element in this document.
+
{{DOMxRef("Document.releaseEvents()")}} {{Non-standard_Inline}} {{Deprecated_Inline}}
+
See {{DOMxRef("Window.releaseEvents()")}}.
+
{{DOMxRef("Document.requestStorageAccess()")}}
+
Returns a {{jsxref("Promise")}} that resolves if the access to first-party storage was granted, and rejects if access was denied.
+
{{DOMxRef("Document.routeEvent()")}} {{Non-standard_Inline}} {{Obsolete_Inline("Gecko24")}}
+
See {{DOMxRef("Window.routeEvent()")}}.
+
{{DOMxRef("Document.mozSetImageElement()")}} {{Non-standard_Inline}}
+
Allows you to change the element being used as the background image for a specified element ID.
+
+ +

The Document interface is extended with the {{DOMxRef("ParentNode")}} interface:

+ +
+
{{DOMxRef("Document.getElementById","document.getElementById(String id)")}}
+
Returns an object reference to the identified element.
+
{{DOMxRef("Document.querySelector()")}}
+
Returns the first Element node within the document, in document order, that matches the specified selectors.
+
{{DOMxRef("Document.querySelectorAll()")}}
+
Returns a list of all the Element nodes within the document that match the specified selectors.
+
+ +

The Document interface is extended with the {{DOMxRef("XPathEvaluator")}} interface:

+ +
+
{{DOMxRef("Document.createExpression()")}}
+
Compiles an XPathExpression which can then be used for (repeated) evaluations.
+
{{DOMxRef("Document.createNSResolver()")}}
+
Creates an {{DOMxRef("XPathNSResolver")}} object.
+
{{DOMxRef("Document.evaluate()")}}
+
Evaluates an XPath expression.
+
+ +

Extension for HTML documents

+ +

The Document interface for HTML documents inherit from the {{DOMxRef("HTMLDocument")}} interface or, since HTML5, is extended for such documents:

+ +
+
{{DOMxRef("Document.clear()")}} {{Non-standard_Inline}} {{Deprecated_Inline}}
+
In majority of modern browsers, including recent versions of Firefox and Internet Explorer, this method does nothing.
+
{{DOMxRef("Document.close()")}}
+
Closes a document stream for writing.
+
{{DOMxRef("Document.execCommand()")}}
+
On an editable document, executes a formating command.
+
{{DOMxRef("Document.getElementsByName()")}}
+
Returns a list of elements with the given name.
+
{{DOMxRef("Document.hasFocus()")}}
+
Returns true if the focus is currently located anywhere inside the specified document.
+
{{DOMxRef("Document.open()")}}
+
Opens a document stream for writing.
+
{{DOMxRef("Document.queryCommandEnabled()")}}
+
Returns true if the formating command can be executed on the current range.
+
{{DOMxRef("Document.queryCommandIndeterm()")}}
+
Returns true if the formating command is in an indeterminate state on the current range.
+
{{DOMxRef("Document.queryCommandState()")}}
+
Returns true if the formating command has been executed on the current range.
+
{{DOMxRef("Document.queryCommandSupported()")}}
+
Returns true if the formating command is supported on the current range.
+
{{DOMxRef("Document.queryCommandValue()")}}
+
Returns the current value of the current range for a formating command.
+
{{DOMxRef("Document.write()")}}
+
Writes text in a document.
+
{{DOMxRef("Document.writeln()")}}
+
Writes a line of text in a document.
+
+ +

Methods included from DocumentOrShadowRoot

+ +

The Document interface includes the following methods defined on the {{DOMxRef("DocumentOrShadowRoot")}} mixin. Note that this is currently only implemented by Chrome; other browsers still implement them on the {{DOMxRef("Document")}} interface.

+ +
+
{{DOMxRef("DocumentOrShadowRoot.getSelection()")}}
+
Returns a {{DOMxRef('Selection')}} object representing the range of text selected by the user, or the current position of the caret.
+
{{DOMxRef("DocumentOrShadowRoot.elementFromPoint()")}}
+
Returns the topmost element at the specified coordinates.
+
{{DOMxRef("DocumentOrShadowRoot.elementsFromPoint()")}}
+
Returns an array of all elements at the specified coordinates.
+
{{DOMxRef("DocumentOrShadowRoot.caretPositionFromPoint()")}}
+
Returns a {{DOMxRef('CaretPosition')}} object containing the DOM node containing the caret, and caret's character offset within that node.
+
+ +

Events

+ +

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

+ +
+
{{DOMxRef("Document/scroll_event", "scroll")}}
+
Fired when the document view or an element has been scrolled.
+ Also available via the {{DOMxRef("GlobalEventHandlers.onscroll", "onscroll")}} property.
+
{{DOMxRef("Document/visibilitychange_event", "visibilitychange")}}
+
Fired when the content of a tab has become visible or has been hidden.
+ Also available via the {{DOMxRef("Document.onvisibilitychange", "onvisibilitychange")}} property.
+
{{DOMxRef("Document/wheel_event","wheel")}}
+
Fired when the user rotates a wheel button on a pointing device (typically a mouse).
+ Also available via the {{DOMxRef("GlobalEventHandlers.onwheel", "onwheel")}} property.
+
+ +

Animation events

+ +
+
{{DOMxRef("Document/animationcancel_event", "animationcancel")}}
+
Fired when an animation unexpectedly aborts.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onanimationcancel", "onanimationcancel")}} property.
+
{{DOMxRef("Document/animationend_event", "animationend")}}
+
Fired when an animation has completed normally.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onanimationend", "onanimationend")}} property.
+
{{DOMxRef("Document/animationiteration_event", "animationiteration")}}
+
Fired when an animation iteration has completed.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onanimationiteration", "onanimationiteration")}} property.
+
{{DOMxRef("Document/animationstart_event", "animationstart")}}
+
Fired when an animation starts.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onanimationstart", "onanimationstart")}} property.
+
+ +

Clipboard events

+ +
+
{{DOMxRef("Document/copy_event", "copy")}}
+
Fired when the user initiates a copy action through the browser's user interface.
+ Also available via the {{DOMxRef("HTMLElement/oncopy", "oncopy")}} property.
+
{{DOMxRef("Document/cut_event", "cut")}}
+
Fired when the user initiates a cut action through the browser's user interface.
+ Also available via the {{DOMxRef("HTMLElement/oncut", "oncut")}} property.
+
{{DOMxRef("Document/paste_event", "paste")}}
+
Fired when the user initiates a paste action through the browser's user interface.
+ Also available via the {{DOMxRef("HTMLElement/onpaste", "onpaste")}} property.
+
+ +

Drag & drop events

+ +
+
{{DOMxRef("Document/drag_event", "drag")}}
+
Fired every few hundred milliseconds as an element or text selection is being dragged by the user.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ondrag", "ondrag")}} property.
+
{{DOMxRef("Document/dragend_event", "dragend")}}
+
Fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key).
+ Also available via the {{DOMxRef("GlobalEventHandlers/ondragend", "ondragend")}} property.
+
{{DOMxRef("Document/dragenter_event", "dragenter")}}
+
Fired when a dragged element or text selection enters a valid drop target.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ondragenter", "ondragenter")}} property.
+
{{DOMxRef("Document/dragexit_event", "dragexit")}}
+
Fired when an element is no longer the drag operation's immediate selection target.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ondragexit", "ondragexit")}} property.
+
{{DOMxRef("Document/dragleave_event", "dragleave")}}
+
Fired when a dragged element or text selection leaves a valid drop target.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ondragleave", "ondragleave")}} property.
+
{{DOMxRef("Document/dragover_event", "dragover")}}
+
Fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds).
+ Also available via the {{DOMxRef("GlobalEventHandlers/ondragover", "ondragover")}} property.
+
{{DOMxRef("Document/dragstart_event", "dragstart")}}
+
Fired when the user starts dragging an element or text selection.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ondragstart", "ondragstart")}} property.
+
{{DOMxRef("Document/drop_event", "drop")}}
+
Fired when an element or text selection is dropped on a valid drop target.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ondrop", "ondrop")}} property.
+
+ +

Fullscreen events

+ +
+
{{DOMxRef("Document/fullscreenchange_event", "fullscreenchange")}}
+
Fired when the Document transitions into or out of full-screen mode.
+ Also available via the {{DOMxRef("Document.onfullscreenchange", "onfullscreenchange")}} property.
+
fullscreenerror
+
Fired if an error occurs while attempting to switch into or out of full-screen mode.
+ Also available via the  {{DOMxRef("Document.onfullscreenerror", "onfullscreenerror")}} property.
+
+

Keyboard events

+
+
{{DOMxRef("Document/keydown_event", "keydown")}}
+
Fired when a key is pressed.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onkeydown", "onkeydown")}} property.
+
{{DOMxRef("Document/keypress_event", "keypress")}}
+
Fired when a key that produces a character value is pressed down. {{Deprecated_Inline}}
+ Also available via the {{DOMxRef("GlobalEventHandlers/onkeypress", "onkeypress")}} property.
+
{{DOMxRef("Document/keyup_event", "keyup")}}
+
Fired when a key is released.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onkeyup", "onkeyup")}} property.
+
+ +

Load & unload events

+ +
+
{{DOMxRef("Document/DOMContentLoaded_event", "DOMContentLoaded")}}
+
Fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
+
{{DOMxRef("Document/readystatechange_event", "readystatechange")}}
+
Fired when the {{DOMxRef("Document/readyState", "readyState")}} attribute of a document has changed.
+ Also available via the onreadystatechange property.
+
+ +

Pointer events

+ +
+
{{DOMxRef("Document/gotpointercapture_event", "gotpointercapture")}}
+
Fired when when an element captures a pointer using setPointerCapture().
+ Also available via the {{DOMxRef("GlobalEventHandlers/ongotpointercapture", "ongotpointercapture")}} property.
+
{{DOMxRef("Document/lostpointercapture_event", "lostpointercapture")}}
+
Fired when a captured pointer is released.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onlostpointercapture", "onlostpointercapture")}} property.
+
{{DOMxRef("Document/pointercancel_event", "pointercancel")}}
+
Fired when a pointer event is canceled.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointercancel", "onpointercancel")}} property.
+
{{DOMxRef("Document/pointerdown_event", "pointerdown")}}
+
Fired when a pointer becomes active.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointerdown", "onpointerdown")}} property.
+
{{DOMxRef("Document/pointerenter_event", "pointerenter")}}
+
Fired when a pointer is moved into the hit test boundaries of an element or one of its descendants.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointerenter", "onpointerenter")}} property.
+
{{DOMxRef("Document/pointerleave_event", "pointerleave")}}
+
Fired when a pointer is moved out of the hit test boundaries of an element.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointerleave", "onpointerleave")}} property.
+
{{DOMxRef("Document/pointerlockchange_event", "pointerlockchange")}}
+
Fired when the pointer is locked/unlocked.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointerlockchange", "onpointerlockchange")}} property.
+
{{DOMxRef("Document/pointerlockerror_event", "pointerlockerror")}}
+
Fired when locking the pointer failed.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointerlockerror", "onpointerlockerror")}} property.
+
{{DOMxRef("Document/pointermove_event", "pointermove")}}
+
Fired when a pointer changes coordinates.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointermove", "onpointermove")}} property.
+
{{DOMxRef("Document/pointerout_event", "pointerout")}}
+
Fired when a pointer is moved out of the hit test boundaries of an element (among other reasons).
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointerout", "onpointerout")}} property.
+
{{DOMxRef("Document/pointerover_event", "pointerover")}}
+
Fired when a pointer is moved into an element's hit test boundaries.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointerover", "onpointerover")}} property.
+
{{DOMxRef("Document/pointerup_event", "pointerup")}}
+
Fired when a pointer is no longer active.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onpointerup", "onpointerup")}} property.
+
+ +

Selection events

+ +
+
{{DOMxRef("Document/selectionchange_event", "selectionchange")}}
+
Fired when the current text selection on a document is changed.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onselectionchange", "onselectionchange")}} property.
+
{{DOMxRef("Document/selectstart_event", "selectstart")}}
+
Fired when the user begins a new selection.
+ Also available via the {{DOMxRef("GlobalEventHandlers/onselectstart", "onselectstart")}} property.
+
+ +

Touch events

+ +
+
{{DOMxRef("Document/touchcancel_event", "touchcancel")}}
+
Fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created).
+ Also available via the {{DOMxRef("GlobalEventHandlers/ontouchcancel", "ontouchcancel")}} property.
+
{{DOMxRef("Document/touchend_event", "touchend")}}
+
Fired when one or more touch points are removed from the touch surface.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ontouchend", "ontouchend")}} property
+
{{DOMxRef("Document/touchmove_event", "touchmove")}}
+
Fired when one or more touch points are moved along the touch surface.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ontouchmove", "ontouchmove")}} property
+
{{DOMxRef("Document/touchstart_event", "touchstart")}}
+
Fired when one or more touch points are placed on the touch surface.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ontouchstart", "ontouchstart")}} property
+
+ +

Transition events

+ +
+
{{DOMxRef("Document/transitioncancel_event", "transitioncancel")}}
+
Fired when a CSS transition is canceled.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ontransitioncancel", "ontransitioncancel")}} property.
+
{{DOMxRef("Document/transitionend_event", "transitionend")}}
+
Fired when a CSS transition has completed.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ontransitionend", "ontransitionend")}} property.
+
{{DOMxRef("Document/transitionrun_event", "transitionrun")}}
+
Fired when a CSS transition is first created.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ontransitionrun", "ontransitionrun")}} property.
+
{{DOMxRef("Document/transitionstart_event", "transitionstart")}}
+
Fired when a CSS transition has actually started.
+ Also available via the {{DOMxRef("GlobalEventHandlers/ontransitionstart", "ontransitionstart")}} property.
+
+ +

Non-standard extensions {{Non-standard_Inline}}

+ +
{{non-standard_header}}
+ +

Firefox notes

+ +

Mozilla defines a set of non-standard properties made only for XUL content:

+ +
+
{{DOMxRef("Document.currentScript")}} {{Non-standard_Inline}}
+
Returns the {{HTMLElement("script")}} element that is currently executing.
+
{{DOMxRef("Document.documentURIObject")}}
+
(Mozilla add-ons only!) Returns the {{Interface("nsIURI")}} object representing the URI of the document. This property only has special meaning in privileged JavaScript code (with UniversalXPConnect privileges).
+
{{DOMxRef("Document.popupNode")}}
+
Returns the node upon which a popup was invoked.
+
{{DOMxRef("Document.tooltipNode")}}
+
Returns the node which is the target of the current tooltip.
+
+ +

Mozilla also define some non-standard methods:

+ +
+
{{DOMxRef("Document.execCommandShowHelp()")}}{{Obsolete_Inline("Gecko14")}}
+
This method never did anything and always threw an exception, so it was removed in Gecko 14.0 {{geckoRelease("14.0")}}.
+
{{DOMxRef("Document.getBoxObjectFor()")}} {{Obsolete_Inline}}
+
Use the {{DOMxRef("Element.getBoundingClientRect()")}} method instead.
+
{{DOMxRef("Document.loadOverlay()")}}{{Obsolete_Inline("Gecko61")}}
+
Loads a XUL overlay dynamically. This only works in XUL documents.
+
{{DOMxRef("Document.queryCommandText()")}}{{Obsolete_Inline("Gecko14")}}
+
This method never did anything but throw an exception, and was removed in Gecko 14 {{GeckoRelease("14")}}.
+
+ +

Internet Explorer notes

+ +

Microsoft defines some non-standard properties:

+ +
+
{{DOMxRef("Document.fileSize")}}* {{Non-standard_Inline}} {{Obsolete_Inline}}
+
Returns size in bytes of the document. Starting with Internet Explorer 11, that property is no longer supported. See MSDN.
+
+ +

Internet Explorer does not support all methods from the Node interface in the Document interface:

+ +
+
{{DOMxRef("Document.contains")}}
+
As a work-around, document.body.contains() can be used.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("DOM WHATWG", "#interface-document", "Document")}}{{Spec2("DOM WHATWG")}}Intend to supersede DOM 3
{{SpecName("HTML WHATWG", "dom.html#the-document-object", "Document")}}{{Spec2("HTML WHATWG")}}Turn the {{DOMxRef("HTMLDocument")}} interface into a Document extension.
{{SpecName("CSSOM View", "#extensions-to-the-document-interface", "Document")}}{{Spec2("CSSOM View")}}Extend the Document interface
{{SpecName("Pointer Lock", "#extensions-to-the-document-interface", "Document")}}{{Spec2("Pointer Lock")}}Extend the Document interface
{{SpecName("Page Visibility API", "#extensions-to-the-document-interface", "Document")}}{{Spec2("Page Visibility API")}}Extend the Document interface with the visibilityState and hidden attributes and the onvisibilitychange event listener.
{{SpecName("Selection API", "#extensions-to-document-interface", "Document")}}{{Spec2("Selection API")}}Adds getSelection(), onselectstart and onselectionchange.
{{SpecName("DOM4", "#interface-document", "Document")}}{{Spec2("DOM4")}}Supersede DOM 3
{{SpecName("DOM3 Core", "#i-Document", "Document")}}{{Spec2("DOM3 Core")}}Supersede DOM 2
{{SpecName("DOM3 XPath", "xpath.html#XPathEvaluator", "XPathEvaluator")}}{{Spec2("DOM3 XPath")}}Define the {{DOMxRef("XPathEvaluator")}} interface which extend document.
{{SpecName("DOM2 Core", "#i-Document", "Document")}}{{Spec2("DOM2 Core")}}Supersede DOM 1
{{SpecName("DOM1", "#i-Document", "Document")}}{{Spec2("DOM1")}}Initial definition for the interface
+ +

Browser compatibility

+ + + +

{{Compat("api.Document")}}

diff --git a/files/hu/web/api/fetch_api/index.html b/files/hu/web/api/fetch_api/index.html new file mode 100644 index 0000000000..807bb11054 --- /dev/null +++ b/files/hu/web/api/fetch_api/index.html @@ -0,0 +1,107 @@ +--- +title: Fetch API +slug: Web/API/Fetch_API +translation_of: Web/API/Fetch_API +--- +
{{DefaultAPISidebar("Fetch API")}}
+ +

A Fetch API egy interfészt biztosít számunkra adatok lekéréséhez (beleértve a hálózaton keresztüli kéréseket is). Ismerősnek fog hatni mindazok számára, akik már használtak {{DOMxRef("XMLHttpRequest")}}-et, de ez az újabb API jóval erőteljesebb és rugalmasabb eszközökkel áll rendelkezésre.

+ +

Concepts and usage

+ +

Fetch provides a generic definition of {{DOMxRef("Request")}} and {{DOMxRef("Response")}} objects (and other things involved with network requests). This will allow them to be used wherever they are needed in the future, whether it’s for service workers, Cache API, and other similar things that handle or modify requests and responses, or any kind of use case that might require you to generate your responses programmatically (that is, the use of computer program or personal programming instructions).

+ +

It also defines related concepts such as CORS and the HTTP Origin header semantics, supplanting their separate definitions elsewhere.

+ +

For making a request and fetching a resource, use the {{DOMxRef("WindowOrWorkerGlobalScope.fetch()")}} method. It is implemented in multiple interfaces, specifically {{DOMxRef("Window")}} and {{DOMxRef("WorkerGlobalScope")}}. This makes it available in pretty much any context you might want to fetch resources in.

+ +

The fetch() method takes one mandatory argument, the path to the resource you want to fetch. It returns a {{DOMxRef("Promise")}} that resolves to the {{DOMxRef("Response")}} to that request, whether it is successful or not. You can also optionally pass in an init options object as the second argument (see {{DOMxRef("Request")}}).

+ +

Once a {{DOMxRef("Response")}} is retrieved, there are a number of methods available to define what the body content is and how it should be handled (see {{DOMxRef("Body")}}).

+ +

You can create a request and response directly using the {{DOMxRef("Request.Request", "Request()")}} and {{DOMxRef("Response.Response", "Response()")}} constructors, but it's uncommon to do this directly. Instead, these are more likely to be created as results of other API actions (for example, {{DOMxRef("FetchEvent.respondWith()")}} from service workers).

+ +

Differences from jQuery

+ +

The fetch specification differs from jQuery.ajax() in three main ways:

+ + + +
+

Note: Find out more about using the Fetch API features in Using Fetch, and study concepts in Fetch basic concepts.

+
+ +

Aborting a fetch

+ +

Browsers have started to add experimental support for the {{DOMxRef("AbortController")}} and {{DOMxRef("AbortSignal")}} interfaces (aka The Abort API), which allow operations like Fetch and XHR to be aborted if they have not already completed. See the interface pages for more details.

+ +

Fetch Interfaces

+ +
+
{{DOMxRef("WindowOrWorkerGlobalScope.fetch()")}}
+
The fetch() method used to fetch a resource.
+
{{DOMxRef("Headers")}}
+
Represents response/request headers, allowing you to query them and take different actions depending on the results.
+
{{DOMxRef("Request")}}
+
Represents a resource request.
+
{{DOMxRef("Response")}}
+
Represents the response to a request.
+
+ +

Fetch mixin

+ +
+
{{DOMxRef("Body")}}
+
Provides methods relating to the body of the response/request, allowing you to declare what its content type is and how it should be handled.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("Fetch")}}{{Spec2("Fetch")}}Initial definition
+ +

Browser compatibility

+ + + +

{{Compat("api.WindowOrWorkerGlobalScope.fetch")}}

+ +

See also

+ + diff --git a/files/hu/web/api/file/index.html b/files/hu/web/api/file/index.html new file mode 100644 index 0000000000..ce77a8fc63 --- /dev/null +++ b/files/hu/web/api/file/index.html @@ -0,0 +1,226 @@ +--- +title: File +slug: Web/API/File +translation_of: Web/API/File +--- +
{{APIRef}}
+ +

ONGOING The File interface provides information about files and allows JavaScript in a web page to access their content.

+ +

File objects are generally retrieved from a {{domxref("FileList")}} object returned as a result of a user selecting files using the {{HTMLElement("input")}} element, from a drag and drop operation's {{domxref("DataTransfer")}} object, or from the mozGetAsFile() API on an {{domxref("HTMLCanvasElement")}}. In Gecko, privileged code can create File objects representing any local file without user interaction (see {{anch("Implementation notes")}} for more information.)

+ +

A File object is a specific kind of a {{domxref("Blob")}}, and can be used in any context that a Blob can. In particular, {{domxref("FileReader")}}, {{domxref("URL.createObjectURL()")}}, {{domxref("ImageBitmapFactories.createImageBitmap()", "createImageBitmap()")}}, and {{domxref("XMLHttpRequest", "", "send()")}} accept both Blobs and Files.

+ +

See Using files from web applications for more information and examples.

+ +

{{InheritanceDiagram}}

+ +

Constructor

+ +
+
{{domxref("File.File", "File()")}}
+
Returns a newly constructed File.
+
+ +

Properties

+ +
+
{{domxref("File.lastModified")}} {{readonlyinline}}
+
Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).
+
{{domxref("File.lastModifiedDate")}} {{readonlyinline}} {{deprecated_inline}} {{gecko_minversion_inline("15.0")}}
+
Returns the last modified Date of the file referenced by the File object.
+
{{domxref("File.name")}} {{readonlyinline}}
+
Returns the name of the file referenced by the File object.
+
{{domxref("File.webkitRelativePath")}} {{readonlyinline}} {{non-standard_inline}}
+
Returns the path the URL of the {{domxref("File")}} is relative to.
+
+ +

File implements {{domxref("Blob")}}, so it also has the following properties available to it:

+ +
+
{{domxref("File.size")}} {{readonlyinline}}
+
Returns the size of the file.
+
{{domxref("File.type")}} {{readonlyinline}}
+
Returns the MIME type of the file.
+
+ +

Methods

+ +

The File interface doesn't define any methods, but inherits methods from the {{domxref("Blob")}} interface:

+ +
+
{{domxref("Blob.slice()", "Blob.slice([start[, end[, contentType]]])")}}
+
Returns a new Blob object containing the data in the specified range of bytes of the source Blob.
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('File API')}}{{Spec2('File API')}}Initial definition
+ +

Browser compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support13{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.9")}}[1]
+ {{CompatGeckoDesktop("7")}}
10.011.56.0
name{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.9.2")}}11.0{{CompatUnknown}}{{CompatUnknown}}
lastModifiedDate {{deprecated_inline}}{{CompatUnknown}}{{CompatNo}}{{CompatGeckoDesktop("15")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
webkitRelativePath {{non-standard_inline}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoDesktop("49")}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
size{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}11.0{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.9")}}[1]
+ {{CompatGeckoMobile("7")}}
{{CompatNo}}11.16.0
name{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.9.2")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
lastModifiedData {{deprecated_inline}}{{CompatUnknown}}{{CompatNo}}{{CompatGeckoMobile("15")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
webkitRelativePath {{non-standard_inline}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("49")}}{{CompatUnknown}}{{CompatVersionUnknown}} +

{{CompatVersionUnknown}}

+
size{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

[1] Non-standard implementation.

+ +

Implementation notes

+ + + +

See also

+ + diff --git a/files/hu/web/api/geolocation/index.html b/files/hu/web/api/geolocation/index.html new file mode 100644 index 0000000000..81d4548549 --- /dev/null +++ b/files/hu/web/api/geolocation/index.html @@ -0,0 +1,118 @@ +--- +title: Geolocation +slug: Web/API/Geolocation +tags: + - API + - Advanced + - Geolocation API + - Interface + - NeedsTranslation + - Reference + - TopicStub +translation_of: Web/API/Geolocation +--- +
{{APIRef("Geolocation API")}}
+ +

The Geolocation interface represents an object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location.

+ +

An object with this interface is obtained using the {{domxref("NavigatorGeolocation.geolocation")}} property implemented by the {{domxref("Navigator")}} object.

+ +
+

Note: For security reasons, when a web page tries to access location information, the user is notified and asked to grant permission. Be aware that each browser has its own policies and methods for requesting this permission.

+
+ +

Properties

+ +

The Geolocation interface neither implements, nor inherits any property.

+ +

Methods

+ +

The Geolocation interface doesn't inherit any method.

+ +
+
{{domxref("Geolocation.getCurrentPosition()")}}
+
Determines the device's current location and gives back a {{domxref("Position")}} object with the data.
+
{{domxref("Geolocation.watchPosition()")}}
+
Returns a long value representing the newly established callback function to be invoked whenever the device location changes.
+
{{domxref("Geolocation.clearWatch()")}}
+
Removes the particular handler previously installed using watchPosition().
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Geolocation')}}{{Spec2('Geolocation')}}Initial specification.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support5{{CompatGeckoDesktop("1.9.1")}}910.60
+ Removed in 15.0
+ Reintroduced in 16.0
5
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown()}}{{CompatUnknown()}}{{CompatGeckoMobile("4")}}{{CompatUnknown()}}10.60{{CompatUnknown()}}
+
+ +

See also

+ + diff --git a/files/hu/web/api/index.html b/files/hu/web/api/index.html new file mode 100644 index 0000000000..14bc9a0a46 --- /dev/null +++ b/files/hu/web/api/index.html @@ -0,0 +1,18 @@ +--- +title: Web API interfaces +slug: Web/API +tags: + - API + - Landing + - NeedsTranslation + - Reference + - TopicStub + - Web + - WebAPI +translation_of: Web/API +--- +

When writing code for the Web using JavaScript, there are a great many APIs available. Below is a list of all the interfaces (that is, types of objects) that you may be able to use while developing your Web app or site. For a list of the APIs that contain each of these interfaces, see Web API reference.

+ +
+
{{APIListAlpha}}
+
diff --git a/files/hu/web/api/webxr_device_api/index.html b/files/hu/web/api/webxr_device_api/index.html new file mode 100644 index 0000000000..0e5c140113 --- /dev/null +++ b/files/hu/web/api/webxr_device_api/index.html @@ -0,0 +1,197 @@ +--- +title: WebXR Device API +slug: Web/API/WebXR_Device_API +translation_of: Web/API/WebXR_Device_API +--- +

{{DefaultAPISidebar("WebXR Device API")}}

+ +

WebXR is a group of standards which are used together to support rendering 3D scenes to hardware designed for presenting virtual worlds (virtual reality, or VR), or for adding graphical imagery to the real world, (augmented reality, or AR). The WebXR Device API implements the core of the WebXR feature set, managing the selection of output devices, render the 3D scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers.

+ +

WebXR-compatible devices include fully-immersive 3D headsets with motion and orientation tracking, eyeglasses which overlay graphics atop the real world scene passing through the frames, and handheld mobile phones which augment reality by capturing the world with a camera and augment that scene with computer-generated imagery.

+ +

To accomplish these things, the WebXR Device API provides the following key capabilities:

+ + + +

At the most basic level, a scene is presented in 3D by computing the perspective to apply to the scene in order to render it from the viewpoint of each of the user's eyes by computing the position of each eye and rendering the scene from that position, looking in the direction the user is currently facing. Each of these two images is rendered into a single framebuffer, with the left eye's rendered image on the left and the right eye's viewpoint rendered into the right half of the buffer. Once both eyes' perspectives on the scene have been rendered, the resulting framebuffer is delivered to the WebXR device to be presented to the user through their headset or other appropriate display device.

+ +

WebXR Device API concepts and usage

+ +
+
Example WebXR hardware setup
+Sketch of a person in a chair with wearing goggles labelled "Head mounted display (HMD)" facing a monitor with a webcam labeled "Position sensor"
+ +

While the older WebVR API was designed solely to support Virtual Reality (VR), WebXR provides support for both VR and Augmented Reality (AR) on the web. Support for AR functionality is added by the WebXR Augmented Reality Module.

+ +

A typical XR device can have either 3 or 6 degrees of freedom and might or might not have an external positional sensor.

+ +

The equipment may also include an accelerometer, barometer, or other sensors which are used to sense when the user moves through space, rotates their head, or the like.

+ +

Accessing the WebXR API

+ +

To gain access to the WebXR API within the context of a given window, use the {{domxref("navigator.xr")}} property, which returns an {{domxref("XRSystem")}} object through which the entire WebXR Device APi is then exposed.

+ +
+
{{domxref("navigator.xr")}} {{ReadOnlyInline}}
+
This property, added to the {{domxref("Navigator")}} interface, returns the {{domxref("XRSystem")}} object through which the WebXR API is exposed. If this property is missing or null, WebXR is not available.
+
+ +

WebXR interfaces

+ +
+
{{DOMxRef("XR")}}
+
The {{domxref("Navigator.xr", "navigator.xr")}} property returns the window's instance of {{domxref("XRSystem")}}, which is the mechanism by which your code accesses the WebXR API. Using the XRSystem interface, you can create {{domxref("XRSession")}}s to represent actual AR and/or VR sessions.
+
{{DOMxRef("XRFrame")}}
+
While presenting an XR session, the state of all tracked objects which make up the session are represented by an XRFrame. To get an XRFrame, call the session's {{domxref("XRSession.requestAnimationFrame", "requestAnimationFrame()")}} method, providing a callback which will be called with the XRFrame once available. Events which communicate tracking states will also use XRFrame to contain that information.
+
{{DOMxRef("XRRenderState")}}
+
Provides a set of configurable properties which change how the imagery output by an XRSession is composited.
+
{{DOMxRef("XRSession")}}
+
Provides the interface for interacting with XR hardware. Once an XRSession is obtained from {{domxref("XRSystem.requestSession", "navigator.xr.requestSession()")}}, the session can be used to check the position and orientation of the viewer, query the device for environment information, and present the virtual or augmented world to the user.
+
{{DOMxRef("XRSpace")}}
+
XRSpace is an opaque base class on which all virtual coordinate system interfaces are based. Positions in WebXR are always expressed in relation to a particular XRSpace at the time at which a particular {{domxref("XFrame")}} takes place. The space's coordinate system has its origin at the a given physical position.
+
{{DOMxRef("XRReferenceSpace")}}
+
A subclass of {{domxref("XRSpace")}} which is used to identify a spatial relationship in relation to the user's physical environment. The XRReferenceSpace coordinate system is expected to remain unchanged through the lifespan of the {{domxref("XRSession")}}.The world has no boundaries and extends infinitely in every direction.
+
{{DOMxRef("XRBoundedReferenceSpace")}}
+
XRBoundedReferenceSpace extends the {{domxref("XRReferenceSpace")}} coordinate system to further include support for a finite world with set boundaries. Unlike XRReferenceSpace, the origin must be located on the floor (that is, y = 0 at the floor). The x and z components of the origin are typically presumed to be located at or near the center of the room or surface.
+
{{DOMxRef("XRView")}}
+
Represents a single view into the XR scene for a particular frame. Each XRView corresponds to the video display surface used to present the scene to the user. For example, a given XR device might have two views: one for the left eye and one for the right. Each view has an offset used to shift the position of the view relative to the camera, in order to allow for creating stereographic effects.
+
{{DOMxRef("XRViewport")}}
+
Describes a viewport. A viewport is a rectangular portion of a graphic surface. In WebXR, a viewport represents the area of a drawing surface corresponding to a particular {{domxref("XRView")}}, such as the portion of the WebGL framebuffer used to render one of the two eyes' perspectives on the scene.
+
{{DOMxRef("XRRigidTransform")}}
+
A transform defined using a position and orientation in the virtual space's coordinate system as described by the {{domxref("XRSpace")}}.
+
{{DOMxRef("XRPose")}}
+
Describes a position and orientation in space relative to an {{domxref("XRSpace")}}.
+
{{DOMxRef("XRViewerPose")}}
+
Based on {{domxref("XRPose")}}, XRViewerPose specifies the state of a viewer of the WebXR scene as indicated by the XR device. Included is an array of {{domxref("XRView")}} objects, each representing one perspective on the scene. For example, it takes two views to create the stereoscopic view as perceived by human vision—one for the left eye and a second for the right eye. One view is offset to the left slightly from the viewer's position, and the other view is offset to the right by the same distance. The view list can also be used to represent the perspectives of each of the spectators of a scene, in a multi-user environment.
+
{{DOMxRef("XRInputSource")}}
+
Represents any input device the user can use to perform targeted actions within the same virtual space as the viewer. Input sources may include devices such as hand controllers, optical tracking systems, and other devices which are explicitly associated with the XR device. Other input devices such as keyboards, mice, and gamepads are not presented as XRInputSource instances.
+
{{DOMxRef("XRWebGLLayer")}}
+
A layer which serves as a WebGL frame buffer into which a scene's view is rendered. Using WebGL to render the scene gains substantial performance benefits due to graphics acceleration.
+
+ +

Event interfaces

+ +

The following interfaces are used to represent the events used by the WebXR API.

+ +
+
{{domxref("XRInputSourceEvent")}}
+
Sent when the state of an {{domxref("XRInputSource")}} changes. This can happen, for example, when the position and/or orientation of the device changes, or when buttons are pressed or released.
+
{{domxref("XRInputSourcesChangeEvent")}}
+
Sent to indicate that the set of available input sources has changed for the {{domxref("XRSession")}}.
+
{{domxref("XRReferenceSpaceEvent")}}
+
Sent when the state of an {{domxref("XRReferenceSpace")}} changes.
+
{{domxref("XRSessionEvent")}}
+
Sent to indicate that the state of an {{domxref("XRSession")}} has changed. For example, if the position and/or orient
+
+ +

Extensions to the WebGL API

+ +

The WebGL API is extended by the WebXR specification to augment the WebGL context to allow it to be used to render views for display by a WebXR device.

+ +
+
{{domxref("WebGLRenderingContextBase.makeXRCompatibile","WebGLRenderingContextBase.makeXRCompatibile()")}}
+
Configures the WebGL context to be compatible with WebXR. If the context was not initially created with the {{domxref("WebGLContextAttributes.xrCompatible", "xrCompatible")}} property set to true, you must call makeXRCompatible() prior to attempting to use the WebGL context for WebXR rendering. Returns a {{jsxref("Promise")}} which resolves once the context has been prepared, or is rejected if the context cannot be configured for use by WebXR.
+
+ +

Guides and tutorials

+ +

The following guides and tutorials are a great resource to learn how to comprehend WebXR and the underlying 3D and VR/AR graphics concepts.

+ +

Foundations and basics

+ +
+
Fundamentals of WebXR
+
Before diving into the details of how to create content using WebXR, it may be helpful to read this overview of the technology, which includes introductions to terminology that may be unfamiliar to you, or which may be used in a new way.
+
Matrix math for the web
+
A guide covering how matrices can be used on the web, including both for CSS transforms and for WebGL purposes, as well as to handle the positioning and orientation of objects in WebXR contexts.
+
WebXR application life cycle
+
An overview of the overall life cycle of a WebXR application, from startup to shutdown. This article serves as an introduction to the basics of what's involved in creating a WebXR experience without diving into the code in detail. It's a good way to prepare for the next steps.
+
+ +

Creating a mixed reality experience

+ +
+
Starting up and shutting down a WebXR session
+
Before actually presenting a scene using an XR device such as a headset or goggles, you need to create a WebXR session bound to a rendering layer that draws the scene for presentation in each of the XR device's displays so that the 3D effect can be presented to the user. This guide covers how to create and stop WebXR sessions.
+
Geometry and reference spaces in WebXR
+
In this guide, the required concepts of 3D geometry are briefly reviewed, and the fundamentals of how that geometry is represented in WebXR are detailed. Learn how reference spaces are used to position objects—and the viewer—and the differences among the available types of reference space, as well as their use cases.
+
Spatial tracking in WebXR
+
This guide describes how objects—including the user's body and its parts—are located in space, and how their movement and orientation relative to one another is monitored and managed over time. This article explains the relationship between spaces, poses, viewers, and views.
+
Rendering and the WebXR frame animation callback
+
Starting with how you schedule frames to be rendered, this guide then continues to cover how to determine the placement of objects in the view and how to then render them into the WebGL buffer used for each of the two eyes' views of the scene.
+
Viewpoints and viewers: Simulating cameras in WebXR
+
WebGL (and therefore WebXR) doesn't really have a concept of a camera, which is the traditional concept used to represent a viewpoint in 3D graphics. In this article, we see how to simulate a camera and how to create the illusion of moving a viewer through a world in which the viewer doesn't really move.
+
Lighting a WebXR setting
+
Since WebXR rendering is based upon WebGL, the same lighting techniques used for any 3D application are applied to WebXR scenes. However, there are issues specific to creating augmented and virtual reality settings that need to be considered when writing your lighting code. This article discusses those issues.
+
Using bounded reference spaces
+
In this article, we examine how to use a bounded-floor reference space to define the boundaries of where the viewer can safely move about without leaving the area tracked by their XR hardware or colliding with a physical obstacle. On devices which support it, bounded-floor can be a useful tool in your repertoire.
+
+ +

Making it interactive

+ +
+
Movement, orientation, and motion: A WebXR example
+
In this example and tutorial, we use information learned throughout the WebXR documentation to create a scene containing a rotating cube which the user can move around using both VR headset and keyboard and mouse.
+
Inputs and input sources
+
A guide to input sources and how to efficiently manage the input devices being used to control the WebXR session, and how to receive and process user inputs from those devices.
+
Targeting and hit detection
+
How to use an input source's targeting ray mode and targeting ray space to display a targeting ray, identify targeted surfaces or objects, and perform related tasks.
+
Using WebXR input profiles
+
A guide to interpreting the {{Glossary("JSON")}} data provided by the WebXR Input Profiles Registry, which can be used to determine what options and controls are available on the user's available input devices.
+
Supporting advanced controllers and gamepads in WebXR applications
+
WebXR uses the {{domxref("Gamepad")}} object to describe the controls available on complex input devices (such as hand controllers with multiple buttons and/or axes) and gamepad-like devices. In this guide, learn how to make use of these devices' controls.
+
+ +

Performance and security

+ +
+
WebXR performance guide
+
Recommendations and tips to help you optimize the performance of your WebXR application.
+
Permissions and security for WebXR
+
The WebXR Device API has several areas of security to contend with, from establishing feature-policy to ensuring the user intends to use the mixed reality presentation before activating it.
+
+ +

Including other media

+ +
+
Positional audio in a 3D environment
+
In 3D environments, which may either be 3D scenes rendered to the screen or a mixed reality experience experienced using a headset, it's important for audio to be performed so that it sounds like it's coming from the direction of its source. This guide covers how to accomplish this.
+
Playing video in a 3D environment
+
In this guide, we examine how to play video into a 3D scene. This technique can be used in both standard WebGL applications presented on a flat computer screen, or in a WebXR-generated virtual or augmented reality environment.
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("WebXR")}}{{Spec2("WebXR")}}Initial definition.
+ +

Browser compatibility

+ +

{{Compat("api.Navigator.xr")}}

+ +

See also

+ + diff --git a/files/hu/web/api/window.stop/index.html b/files/hu/web/api/window.stop/index.html new file mode 100644 index 0000000000..142a71788d --- /dev/null +++ b/files/hu/web/api/window.stop/index.html @@ -0,0 +1,19 @@ +--- +title: window.stop +slug: Web/API/Window.stop +translation_of: Web/API/Window/stop +--- +
+  {{ApiRef}}
+

Összefoglalás

+

Ez az eljárás leállítja az ablak betöltését.

+

Szintaxis

+
window.stop()
+
+

Példa

+
window.stop();
+
+

Megjegyzések

+

A stop() eljárás teljesen megegyezik azzal, amikor a 'megállás/betöltés megszakítása' gombra kattint a böngészőben. Amiatt a szabály miatt, melyben a kódok betöltöttek, a stop() eljárás nem állítja le azt, amit csak betölteni kell (nem letölteni a megjelenítéshez), de megszakítja a nagy képek, új ablakok, és egyéb objektumok betöltését, melynek el van halasztva a betöltése.

+

Tulajdonságok

+

DOM szint: 0. Nem része a tulajdonságoknak.

diff --git a/files/hu/web/api/window/alert/index.html b/files/hu/web/api/window/alert/index.html new file mode 100644 index 0000000000..3861de7f10 --- /dev/null +++ b/files/hu/web/api/window/alert/index.html @@ -0,0 +1,72 @@ +--- +title: Window.alert() +slug: Web/API/Window/alert +tags: + - API + - DOM + - Függvény + - Referencia + - Window + - alert +translation_of: Web/API/Window/alert +--- +

{{ APIRef }}

+ +

A window.alert() függvény megjelenít egy alert ablakot a megadott opcionális szöveggel és egy OK gombbal.

+ +

Szintaxis

+ +
window.alert(uzenet);
+ +

Paraméterek

+ +
+
uzenet {{optional_inline}}
+
Az üzenet az a szöveg amit meg szeretnél jeleníteni az alert dobozban.
+
+ +

Példa

+ +
window.alert("Hello world!");
+alert("Hello world!");
+ +

Mindkettő kimenete:

+ +

Image:AlertHelloWorld.png

+ +

Megjegyzések

+ +

Az alertet olyan helyeken kell használni, ahol nem szükséges visszajelzés a felhasználótól, de szeretnénk őt értesíteni valamiről.

+ +

The following text is shared between this article, DOM:window.prompt and DOM:window.confirm Ez egy modális ablak - megakadályozza a felhasználót, hogy elérje a felületet, amíg be nem zárja azt. Éppen ezért nem ajánlott a túlhasználata.

+ +

Specifikáció

+ + + + + + + + + + + + + + +
SpecifikációÁllapotMegjegyzés
{{SpecName('HTML WHATWG', 'timers-and-user-prompts.html#dom-alert', 'alert()')}}{{Spec2('HTML WHATWG')}}
+ +

Böngésző kompatibilitás

+ + + +

{{Compat("api.Window.alert")}}

+ +

Lásd még

+ + diff --git a/files/hu/web/api/window/index.html b/files/hu/web/api/window/index.html new file mode 100644 index 0000000000..9fc6f57e24 --- /dev/null +++ b/files/hu/web/api/window/index.html @@ -0,0 +1,729 @@ +--- +title: Window +slug: Web/API/Window +tags: + - API + - Browser + - DOM + - Interface + - JavaScript + - NeedsTranslation + - Reference + - Tab + - TopicStub + - Window + - global + - global scope + - scope +translation_of: Web/API/Window +--- +
{{APIRef("DOM")}}
+ +

The Window interface represents a window containing a DOM document; the document property points to the DOM document loaded in that window. A window for a given document can be obtained using the {{domxref("document.defaultView")}} property.

+ +

A global variable, window, representing the window in which the script is running, is exposed to JavaScript code.

+ +

The Window interface is home to a variety of functions, namespaces, objects, and constructors which are not necessarily directly associated with the concept of a user interface window. However, the Window interface is a suitable place to include these items that need to be globally available. Many of these are documented in the JavaScript Reference and the DOM Reference.

+ +

In a tabbed browser, each tab is represented by its own Window object; the global window seen by JavaScript code running within a given tab always represents the tab in which the code is running. That said, even in a tabbed browser, some properties and methods still apply to the overall window that contains the tab, such as {{Domxref("Window.resizeTo", "resizeTo()")}} and {{Domxref("Window.innerHeight", "innerHeight")}}. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.

+ +

{{InheritanceDiagram}}

+ +

Constructors

+ +

See also the DOM Interfaces.

+ +
+
{{domxref("DOMParser")}}
+
DOMParser can parse XML or HTML source stored in a string into a DOM Document. DOMParser is specified in DOM Parsing and Serialization.
+
{{domxref("Window.GeckoActiveXObject")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Image")}}
+
Used for creating an {{domxref("HTMLImageElement")}}.
+
{{domxref("Option")}}
+
Used for creating an {{domxref("HTMLOptionElement")}}
+
{{domxref("Window.QueryInterface")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.StaticRange")}} {{experimental_inline}} {{readonlyinline}}
+
Returns a {{domxref('StaticRange.StaticRange','StaticRange()')}} constructor which creates a {{domxref('StaticRange')}} object.
+
{{domxref("Worker")}}
+
Used for creating a Web worker
+
{{domxref("Window.XMLSerializer")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.XPCNativeWrapper")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.XPCSafeJSObjectWrapper")}}
+
{{todo("NeedsContents")}}
+
+ +

Properties

+ +

This interface inherits properties from the {{domxref("EventTarget")}} interface and implements properties from the {{domxref("WindowOrWorkerGlobalScope")}} and {{domxref("WindowEventHandlers")}} mixins.

+ +

Note that properties which are objects (e.g.,. for overriding the prototype of built-in elements) are listed in a separate section below.

+ +
+
{{domxref("Window.closed")}} {{Non-standard_inline}} {{readOnlyInline}}
+
This property indicates whether the current window is closed or not.
+
{{domxref("Window.console")}} {{ReadOnlyInline}}
+
Returns a reference to the console object which provides access to the browser's debugging console.
+
{{domxref("Window.content")}} and Window._content {{Non-standard_inline}} {{obsolete_inline}} {{ReadOnlyInline}}
+
Returns a reference to the content element in the current window. Since Firefox 57 (initially Nightly-only), both versions are only available from chrome (privileged) code, and not available to the web anymore.
+
{{domxref("Window.controllers")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
Returns the XUL controller objects for the current chrome window.
+
{{domxref("Window.customElements")}} {{ReadOnlyInline}}
+
returns a reference to the {{domxref("CustomElementRegistry")}} object, which can be used to register new custom elements and get information about previously registered custom elements.
+
{{domxref("Window.crypto")}} {{readOnlyInline}}
+
Returns the browser crypto object.
+
{{domxref("Window.defaultStatus")}} {{Obsolete_inline("gecko23")}}
+
Gets/sets the status bar text for the given window.
+
{{domxref("Window.devicePixelRatio")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
Returns the ratio between physical pixels and device independent pixels in the current display.
+
{{domxref("Window.dialogArguments")}} {{Fx_minversion_inline(3)}} {{ReadOnlyInline}}
+
Gets the arguments passed to the window (if it's a dialog box) at the time {{domxref("window.showModalDialog()")}} was called. This is an {{Interface("nsIArray")}}.
+
{{domxref("Window.directories")}} {{obsolete_inline}}
+
Synonym of {{domxref("window.personalbar")}}
+
{{domxref("Window.document")}} {{ReadOnlyInline}}
+
Returns a reference to the document that the window contains.
+
{{domxref("Window.DOMMatrix")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMMatrix")}} object, which represents 4x4 matrices, suitable for 2D and 3D operations.
+
{{domxref("Window.DOMMatrixReadOnly")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMMatrixReadOnly")}} object, which represents 4x4 matrices, suitable for 2D and 3D operations.
+
{{domxref("Window.DOMPoint")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMPoint")}} object, which represents a 2D or 3D point in a coordinate system.
+
{{domxref("Window.DOMPointReadOnly")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMPointReadOnly")}} object, which represents a 2D or 3D point in a coordinate system.
+
{{domxref("Window.DOMQuad")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMQuad")}} object, which provides represents a quadrilaterial object, that is one having four corners and four sides.
+
{{domxref("Window.DOMRect")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMRect")}} object, which represents a rectangle.
+
{{domxref("Window.DOMRectReadOnly")}} {{readOnlyInline}} {{experimental_inline}}
+
Returns a reference to a {{domxref("DOMRectReadOnly")}} object, which represents a rectangle.
+
{{domxref("Window.event")}} {{ReadOnlyInline}}
+
Returns the current event, which is the event currently being handled by the JavaScript code's context, or undefined if no event is currently being handled. The {{domxref("Event")}} object passed directly to event handlers should be used instead whenever possible.
+
{{domxref("Window.frameElement")}} {{readOnlyInline}}
+
Returns the element in which the window is embedded, or null if the window is not embedded.
+
{{domxref("Window.frames")}} {{readOnlyInline}}
+
Returns an array of the subframes in the current window.
+
{{domxref("Window.fullScreen")}} {{gecko_minversion_inline("1.9")}}
+
This property indicates whether the window is displayed in full screen or not.
+
{{domxref("Window.globalStorage")}} {{gecko_minversion_inline("1.8.1")}} {{Non-standard_inline}} {{Obsolete_inline("gecko13")}}
+
Unsupported since Gecko 13 (Firefox 13). Use {{domxref("Window.localStorage")}} instead.
+ Was: Multiple storage objects that are used for storing data across multiple pages.
+
{{domxref("Window.history")}} {{ReadOnlyInline}}
+
Returns a reference to the history object.
+
{{domxref("Window.innerHeight")}} {{readOnlyInline}}
+
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
+
{{domxref("Window.innerWidth")}} {{readOnlyInline}}
+
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
+
{{domxref("Window.isSecureContext")}} {{experimental_inline}} {{readOnlyInline}}
+
Indicates whether a context is capable of using features that require secure contexts.
+
{{domxref("Window.length")}} {{readOnlyInline}}
+
Returns the number of frames in the window. See also {{domxref("window.frames")}}.
+
{{domxref("Window.location")}}
+
Gets/sets the location, or current URL, of the window object.
+
{{domxref("Window.locationbar")}} {{ReadOnlyInline}}
+
Returns the locationbar object, whose visibility can be toggled in the window.
+
{{domxref("Window.localStorage")}} {{readOnlyInline}} {{gecko_minversion_inline("1.9.1")}}
+
Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it.
+
{{domxref("Window.menubar")}} {{ReadOnlyInline}}
+
Returns the menubar object, whose visibility can be toggled in the window.
+
{{domxref("Window.messageManager")}} {{gecko_minversion_inline("2.0")}}
+
Returns the message manager object for this window.
+
{{domxref("Window.mozAnimationStartTime")}} {{ReadOnlyInline}} {{gecko_minversion_inline("2.0")}} {{Deprecated_inline}}
+
The time in milliseconds since epoch at which the current animation cycle began. Use {{domxref("Animation.startTime")}} instead.
+
{{domxref("Window.mozInnerScreenX")}} {{ReadOnlyInline}} {{non-standard_inline}} {{gecko_minversion_inline("1.9.2")}}
+
Returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel in {{interface("nsIDOMWindowUtils")}} for a conversion factor to adapt to screen pixels if needed.
+
{{domxref("Window.mozInnerScreenY")}} {{ReadOnlyInline}} {{non-standard_inline}} {{gecko_minversion_inline("1.9.2")}}
+
Returns the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel for a conversion factor to adapt to screen pixels if needed.
+
{{domxref("Window.mozPaintCount")}} {{non-standard_inline}} {{ReadOnlyInline}} {{gecko_minversion_inline("2.0")}}
+
Returns the number of times the current document has been rendered to the screen in this window. This can be used to compute rendering performance.
+
{{domxref("Window.name")}}
+
Gets/sets the name of the window.
+
{{domxref("Window.navigator")}} {{readOnlyInline}}
+
Returns a reference to the navigator object.
+
{{domxref("Window.opener")}}
+
Returns a reference to the window that opened this current window.
+
{{domxref("Window.orientation")}} {{non-standard_inline}} {{deprecated_inline}} {{readOnlyInline}}
+
Returns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation.
+
{{domxref("Window.outerHeight")}} {{readOnlyInline}}
+
Gets the height of the outside of the browser window.
+
{{domxref("Window.outerWidth")}} {{readOnlyInline}}
+
Gets the width of the outside of the browser window.
+
{{domxref("Window.scrollX","Window.pageXOffset")}} {{readOnlyInline}}
+
An alias for {{domxref("window.scrollX")}}.
+
{{domxref("Window.scrollY","Window.pageYOffset")}} {{readOnlyInline}}
+
An alias for {{domxref("window.scrollY")}}
+
{{domxref("Window.parent")}} {{readOnlyInline}}
+
Returns a reference to the parent of the current window or subframe.
+
{{domxref("Window.performance")}} {{readOnlyInline}}
+
Returns a {{domxref("Performance")}} object, which includes the {{domxref("Performance.timing", "timing")}} and {{domxref("Performance.navigation", "navigation")}} attributes, each of which is an object providing performance-related data. See also Using Navigation Timing for additional information and examples.
+
{{domxref("Window.personalbar")}} {{readOnlyInline}}
+
Returns the personalbar object, whose visibility can be toggled in the window.
+
{{domxref("Window.pkcs11")}} {{obsolete_inline(29)}}
+
Formerly provided access to install and remove PKCS11 modules.
+
{{domxref("Window.returnValue")}} {{Fx_minversion_inline(3)}}
+
The return value to be returned to the function that called {{domxref("window.showModalDialog()")}} to display the window as a modal dialog.
+
{{domxref("Window.screen")}} {{readOnlyInline}}
+
Returns a reference to the screen object associated with the window.
+
{{domxref("Window.screenX")}} and {{domxref("Window.screenLeft")}} {{readOnlyInline}}
+
Both properties return the horizontal distance from the left border of the user's browser viewport to the left side of the screen.
+
{{domxref("Window.screenY")}} and {{domxref("Window.screenTop")}} {{readOnlyInline}}
+
Both properties return the vertical distance from the top border of the user's browser viewport to the top side of the screen.
+
{{domxref("Window.scrollbars")}} {{readOnlyInline}}
+
Returns the scrollbars object, whose visibility can be toggled in the window.
+
{{domxref("Window.scrollMaxX")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
+
{{domxref("Window.scrollMaxY")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
+
{{domxref("Window.scrollX")}} {{readOnlyInline}}
+
Returns the number of pixels that the document has already been scrolled horizontally.
+
{{domxref("Window.scrollY")}} {{readOnlyInline}}
+
Returns the number of pixels that the document has already been scrolled vertically.
+
{{domxref("Window.self")}} {{ReadOnlyInline}}
+
Returns an object reference to the window object itself.
+
{{domxref("Window.sessionStorage")}}
+
Returns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
+
{{domxref("Window.sidebar")}} {{non-standard_inline}} {{ReadOnlyInline}}
+
Returns a reference to the window object of the sidebar.
+
{{domxref("Window.speechSynthesis")}} {{ReadOnlyInline}}
+
Returns a {{domxref("SpeechSynthesis")}} object, which is the entry point into using Web Speech API speech synthesis functionality.
+
{{domxref("Window.status")}}
+
Gets/sets the text in the statusbar at the bottom of the browser.
+
{{domxref("Window.statusbar")}} {{readOnlyInline}}
+
Returns the statusbar object, whose visibility can be toggled in the window.
+
{{domxref("Window.toolbar")}} {{readOnlyInline}}
+
Returns the toolbar object, whose visibility can be toggled in the window.
+
{{domxref("Window.top")}} {{readOnlyInline}}
+
Returns a reference to the topmost window in the window hierarchy. This property is read only.
+
{{domxref("Window.visualViewport")}} {{readOnlyInline}}
+
Returns a {{domxref("VisualViewport")}} object which represents the visual viewport for a given window.
+
{{domxref("Window.window")}} {{ReadOnlyInline}}
+
Returns a reference to the current window.
+
window[0], window[1], etc.
+
Returns a reference to the window object in the frames. See {{domxref("Window.frames")}} for more details.
+
+ +

Properties implemented from elsewhere

+ +
+
{{domxref("WindowOrWorkerGlobalScope.caches")}} {{readOnlyinline}}
+
Returns the {{domxref("CacheStorage")}} object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.
+
{{domxref("WindowOrWorkerGlobalScope.indexedDB")}} {{readonlyInline}}
+
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an {{domxref("IDBFactory")}} object.
+
{{domxref("WindowOrWorkerGlobalScope.isSecureContext")}} {{readOnlyinline}}
+
Returns a boolean indicating whether the current context is secure (true) or not (false).
+
{{domxref("WindowOrWorkerGlobalScope.origin")}} {{readOnlyinline}}
+
Returns the global object's origin, serialized as a string. (This does not yet appear to be implemented in any browser.)
+
+ +

Methods

+ +

This interface inherits methods from the {{domxref("EventTarget")}} interface and implements methods from {{domxref("WindowOrWorkerGlobalScope")}} and {{domxref("EventTarget")}}.

+ +
+
{{domxref("Window.alert()")}}
+
Displays an alert dialog.
+
{{domxref("Window.back()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Moves back one in the window history. This method is obsolete; you should instead use {{domxref("History.back", "window.history.back()")}}.
+
{{domxref("Window.blur()")}}
+
Sets focus away from the window.
+
{{domxref("Window.cancelAnimationFrame()")}} {{experimental_inline}}
+
Enables you to cancel a callback previously scheduled with {{domxref("Window.requestAnimationFrame")}}.
+
{{domxref("Window.cancelIdleCallback()")}} {{experimental_inline}}
+
Enables you to cancel a callback previously scheduled with {{domxref("Window.requestIdleCallback")}}.
+
{{domxref("Window.captureEvents()")}} {{Deprecated_inline}}
+
Registers the window to capture all events of the specified type.
+
{{domxref("Window.clearImmediate()")}}
+
Cancels the repeated execution set using setImmediate.
+
{{domxref("Window.close()")}}
+
Closes the current window.
+
{{domxref("Window.confirm()")}}
+
Displays a dialog with a message that the user needs to respond to.
+
{{domxref("Window.disableExternalCapture()")}} {{obsolete_inline(24)}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.dispatchEvent()")}}
+
Used to trigger an event.
+
{{domxref("Window.dump()")}} {{Non-standard_inline}}
+
Writes a message to the console.
+
{{domxref("Window.enableExternalCapture()")}} {{obsolete_inline(24)}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.find()")}}
+
Searches for a given string in a window.
+
{{domxref("Window.focus()")}}
+
Sets focus on the current window.
+
{{domxref("Window.forward()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Moves the window one document forward in the history. This method is obsolete; you should instead use {{domxref("History.forward", "window.history.forward()")}}.
+
{{domxref("Window.getAttention()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Flashes the application icon.
+
{{domxref("Window.getAttentionWithCycleCount()")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.getComputedStyle()")}}
+
Gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
+
{{domxref("Window.getDefaultComputedStyle()")}} {{Non-standard_inline}}
+
Gets default computed style for the specified element, ignoring author stylesheets.
+
{{domxref("Window.getSelection()")}}
+
Returns the selection object representing the selected item(s).
+
{{domxref("Window.home()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Returns the browser to the home page.
+
{{domxref("Window.matchMedia()")}} {{gecko_minversion_inline("6.0")}}
+
Returns a {{domxref("MediaQueryList")}} object representing the specified media query string.
+
{{domxref("Window.maximize()")}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.minimize()")}} (top-level XUL windows only)
+
Minimizes the window.
+
{{domxref("Window.moveBy()")}}
+
Moves the current window by a specified amount.
+
{{domxref("Window.moveTo()")}}
+
Moves the window to the specified coordinates.
+
{{domxref("Window.open()")}}
+
Opens a new window.
+
{{domxref("Window.openDialog()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
Opens a new dialog window.
+
{{domxref("Window.postMessage()")}} {{Fx_minversion_inline(3)}}
+
Provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first.
+
{{domxref("Window.print()")}}
+
Opens the Print Dialog to print the current document.
+
{{domxref("Window.prompt()")}}
+
Returns the text entered by the user in a prompt dialog.
+
{{domxref("Window.releaseEvents()")}} {{Non-standard_inline}} {{Deprecated_inline}}
+
Releases the window from trapping events of a specific type.
+
{{domxref("Window.requestAnimationFrame()")}} {{gecko_minversion_inline("2.0")}}
+
Tells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame.
+
{{domxref("Window.requestIdleCallback()")}}  {{experimental_inline}}
+
Enables the scheduling of tasks during a browser's idle periods.
+
{{domxref("Window.resizeBy()")}}
+
Resizes the current window by a certain amount.
+
{{domxref("Window.resizeTo()")}}
+
Dynamically resizes window.
+
{{domxref("Window.restore()")}} {{Non-standard_inline}} {{obsolete_inline}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.routeEvent()")}} {{obsolete_inline(24)}}
+
{{todo("NeedsContents")}}
+
{{domxref("Window.scroll()")}}
+
Scrolls the window to a particular place in the document.
+
{{domxref("Window.scrollBy()")}}
+
Scrolls the document in the window by the given amount.
+
{{domxref("Window.scrollByLines()")}} {{Non-standard_inline}}
+
Scrolls the document by the given number of lines.
+
{{domxref("Window.scrollByPages()")}} {{Non-standard_inline}}
+
Scrolls the current document by the specified number of pages.
+
{{domxref("Window.scrollTo()")}}
+
Scrolls to a particular set of coordinates in the document.
+
{{domxref("Window.setCursor()")}} {{Non-standard_inline}} (top-level XUL windows only)
+
Changes the cursor for the current window
+
{{domxref("Window.setImmediate()")}}
+
Executes a function after the browser has finished other heavy tasks
+
{{domxref("Window.setResizable()")}} {{Non-standard_inline}}
+
Toggles a user's ability to resize a window.
+
{{domxref("Window.sizeToContent()")}} {{Non-standard_inline}}
+
Sizes the window according to its content.
+
{{domxref("Window.stop()")}}
+
This method stops window loading.
+
{{domxref("Window.updateCommands()")}} {{Non-standard_inline}}
+
Updates the state of commands of the current chrome window (UI).
+
+ +

Methods implemented from elsewhere

+ +
+
{{domxref("EventTarget.addEventListener()")}}
+
Register an event handler to a specific event type on the window.
+
{{domxref("WindowOrWorkerGlobalScope.atob()")}}
+
Decodes a string of data which has been encoded using base-64 encoding.
+
{{domxref("WindowOrWorkerGlobalScope.btoa()")}}
+
Creates a base-64 encoded ASCII string from a string of binary data.
+
{{domxref("WindowOrWorkerGlobalScope.clearInterval()")}}
+
Cancels the repeated execution set using {{domxref("WindowOrWorkerGlobalScope.setInterval()")}}.
+
{{domxref("WindowOrWorkerGlobalScope.clearTimeout()")}}
+
Cancels the delayed execution set using {{domxref("WindowOrWorkerGlobalScope.setTimeout()")}}.
+
{{domxref("WindowOrWorkerGlobalScope.createImageBitmap()")}}
+
Accepts a variety of different image sources, and returns a {{domxref("Promise")}} which resolves to an {{domxref("ImageBitmap")}}. Optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh.
+
{{domxref("WindowOrWorkerGlobalScope.fetch()")}}
+
Starts the process of fetching a resource from the network.
+
{{domxref("EventTarget.removeEventListener")}}
+
Removes an event listener from the window.
+
{{domxref("WindowOrWorkerGlobalScope.setInterval()")}}
+
Schedules a function to execute every time a given number of milliseconds elapses.
+
{{domxref("WindowOrWorkerGlobalScope.setTimeout()")}}
+
Schedules a function to execute in a given amount of time.
+
+ +

Obsolete methods

+ +
+
{{domxref("Window.showModalDialog()")}} {{obsolete_inline}}
+
Displays a modal dialog. This method was removed completely in Chrome 43, and Firefox 55.
+
+ +

Event handlers

+ +

These are properties of the window object that can be set to establish event handlers for the various things that can happen in the window that might be of interest.

+ +

This interface inherits event handlers from the {{domxref("EventTarget")}} interface and implements event handlers from {{domxref("WindowEventHandlers")}}.

+ +
+

Note: Starting in {{Gecko("9.0")}}, you can now use the syntax if ("onabort" in window) to determine whether or not a given event handler property exists. This is because event handler interfaces have been updated to be proper web IDL interfaces. See DOM event handlers for details.

+
+ +
+
{{domxref("Window.onappinstalled")}}
+
Called when the page is installed as a webapp. See {{event('appinstalled')}} event.
+
{{domxref("Window.onbeforeinstallprompt")}}
+
An event handler property dispatched before a user is prompted to save a web site to a home screen on mobile.
+
{{domxref("Window.ondevicelight")}}
+
An event handler property for any ambient light levels changes
+
{{domxref("Window.ondevicemotion")}} {{gecko_minversion_inline("6.0")}}
+
Called if accelerometer detects a change (For mobile devices)
+
{{domxref("Window.ondeviceorientation")}} {{gecko_minversion_inline("6.0")}}
+
Called when the orientation is changed (For mobile devices)
+
{{domxref("Window.ondeviceorientationabsolute")}} {{non-standard_inline}} Chrome only
+
An event handler property for any device orientation changes.
+
{{domxref("Window.ondeviceproximity")}}
+
An event handler property for device proximity event
+
{{domxref("Window.ongamepadconnected")}}
+
Represents an event handler that will run when a gamepad is connected (when the {{event('gamepadconnected')}} event fires).
+
{{domxref("Window.ongamepaddisconnected")}}
+
Represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).
+
{{domxref("Window.onmozbeforepaint")}} {{gecko_minversion_inline("2.0")}}
+
An event handler property for the MozBeforePaint event, which is sent before repainting the window if the event has been requested by a call to the {{domxref("Window.mozRequestAnimationFrame()")}} method.
+
{{domxref("Window.onpaint")}}
+
An event handler property for paint events on the window.
+
{{domxref("Window.onrejectionhandled")}} {{experimental_inline}}
+
An event handler for handled {{jsxref("Promise")}} rejection events.
+
{{domxref("Window.onuserproximity")}}
+
An event handler property for user proximity events.
+
{{domxref("Window.onvrdisplayconnect")}}
+
Represents an event handler that will run when a compatible VR device has been connected to the computer (when the {{event("vrdisplayconnected")}} event fires).
+
{{domxref("Window.onvrdisplaydisconnect")}}
+
Represents an event handler that will run when a compatible VR device has been disconnected from the computer (when the {{event("vrdisplaydisconnected")}} event fires).
+
{{domxref("Window.onvrdisplayactivate")}}
+
Represents an event handler that will run when a display is able to be presented to (when the {{event("vrdisplayactivate")}} event fires), for example if an HMD has been moved to bring it out of standby, or woken up by being put on.
+
{{domxref("Window.onvrdisplaydeactivate")}}
+
Represents an event handler that will run when a display can no longer be presented to (when the {{event("vrdisplaydeactivate")}} event fires), for example if an HMD has gone into standby or sleep mode due to a period of inactivity.
+
{{domxref("Window.onvrdisplayblur")}}
+
Represents an event handler that will run when presentation to a display has been paused for some reason by the browser, OS, or VR hardware (when the {{event("vrdisplayblur")}} event fires) — for example, while the user is interacting with a system menu or browser, to prevent tracking or loss of experience.
+
{{domxref("Window.onvrdisplayfocus")}}
+
Represents an event handler that will run when presentation to a display has resumed after being blurred (when the {{event("vrdisplayfocus")}} event fires).
+
{{domxref("Window.onvrdisplaypresentchange")}}
+
represents an event handler that will run when the presenting state of a VR device changes — i.e. goes from presenting to not presenting, or vice versa (when the {{event("vrdisplaypresentchange")}} event fires).
+
+ +

Event handlers implemented from elsewhere

+ +
+
{{domxref("GlobalEventHandlers.onabort")}}
+
Called when the loading of a resource has been aborted, such as by a user canceling the load while it is still in progress
+
{{domxref("WindowEventHandlers.onafterprint")}}
+
Called when the print dialog box is closed. See {{event("afterprint")}} event.
+
{{domxref("WindowEventHandlers.onbeforeprint")}}
+
Called when the print dialog box is opened. See {{event("beforeprint")}} event.
+
{{domxref("WindowEventHandlers.onbeforeunload")}}
+
An event handler property for before-unload events on the window.
+
{{domxref("GlobalEventHandlers.onblur")}}
+
Called after the window loses focus, such as due to a popup.
+
{{domxref("GlobalEventHandlers.onchange")}}
+
An event handler property for change events on the window.
+
{{domxref("GlobalEventHandlers.onclick")}}
+
Called after the ANY mouse button is pressed & released
+
{{domxref("GlobalEventHandlers.ondblclick")}}
+
Called when a double click is made with ANY mouse button.
+
{{domxref("GlobalEventHandlers.onclose")}}
+
Called after the window is closed
+
{{domxref("GlobalEventHandlers.oncontextmenu")}}
+
Called when the RIGHT mouse button is pressed
+
{{domxref("GlobalEventHandlers.onerror")}}
+
Called when a resource fails to load OR when an error occurs at runtime. See {{event("error")}} event.
+
{{domxref("GlobalEventHandlers.onfocus")}}
+
Called after the window receives or regains focus. See {{event("focus")}} events.
+
{{domxref("WindowEventHandlers.onhashchange")}} {{gecko_minversion_inline("1.9.2")}}
+
An event handler property for {{event('hashchange')}} events on the window; called when the part of the URL after the hash mark ("#") changes.
+
{{domxref("GlobalEventHandlers.oninput")}}
+
Called when the value of an <input> element changes
+
{{domxref("GlobalEventHandlers.onkeydown")}}
+
Called when you begin pressing ANY key. See {{event("keydown")}} event.
+
{{domxref("GlobalEventHandlers.onkeypress")}}
+
Called when a key (except Shift, Fn, and CapsLock) is in pressed position. See {{event("keypress")}} event.
+
{{domxref("GlobalEventHandlers.onkeyup")}}
+
Called when you finish releasing ANY key. See {{event("keyup")}} event.
+
{{domxref("WindowEventHandlers.onlanguagechange")}}
+
An event handler property for {{event("languagechange")}} events on the window.
+
{{domxref("GlobalEventHandlers.onload")}}
+
Called after all resources and the DOM are fully loaded. WILL NOT get called when the page is loaded from cache, such as with back button.
+
{{domxref("WindowEventHandlers.onmessage")}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("message")}} event is raised.
+
{{domxref("GlobalEventHandlers.onmousedown")}}
+
Called when ANY mouse button is pressed.
+
{{domxref("GlobalEventHandlers.onmousemove")}}
+
Called continously when the mouse is moved inside the window.
+
{{domxref("GlobalEventHandlers.onmouseout")}}
+
Called when the pointer leaves the window.
+
{{domxref("GlobalEventHandlers.onmouseover")}}
+
Called when the pointer enters the window
+
{{domxref("GlobalEventHandlers.onmouseup")}}
+
Called when ANY mouse button is released
+
{{domxref("WindowEventHandlers.onoffline")}}
+
Called when network connection is lost. See {{event("offline")}} event.
+
{{domxref("WindowEventHandlers.ononline")}}
+
Called when network connection is established. See {{event("online")}} event.
+
{{domxref("WindowEventHandlers.onpagehide")}}
+
Called when the user navigates away from the page, before the onunload event. See {{event("pagehide")}} event.
+
{{domxref("WindowEventHandlers.onpageshow")}}
+
Called after all resources and the DOM are fully loaded. See {{event("pageshow")}} event.
+
{{domxref("WindowEventHandlers.onpopstate")}} {{gecko_minversion_inline("2.0")}}
+
Called when a back button is pressed.
+
{{domxref("GlobalEventHandlers.onreset")}}
+
Called when a form is reset
+
{{domxref("GlobalEventHandlers.onresize")}}
+
Called continuously as you are resizing the window.
+
{{domxref("GlobalEventHandlers.onscroll")}}
+
Called when the scroll bar is moved via ANY means. If the resource fully fits in the window, then this event cannot be invoked
+
{{domxref("GlobalEventHandlers.onwheel")}}
+
Called when the mouse wheel is rotated around any axis
+
{{domxref("GlobalEventHandlers.onselect")}}
+
Called after text in an input field is selected
+
{{domxref("GlobalEventHandlers.onselectionchange")}}
+
Is an {{domxref("EventHandler")}} representing the code to be called when the {{event("selectionchange")}} event is raised.
+
{{domxref("WindowEventHandlers.onstorage")}}
+
Called when there is a change in session storage or local storage. See {{event("storage")}} event
+
{{domxref("GlobalEventHandlers.onsubmit")}}
+
Called when a form is submitted
+
{{domxref("WindowEventHandlers.onunhandledrejection")}} {{experimental_inline}}
+
An event handler for unhandled {{jsxref("Promise")}} rejection events.
+
{{domxref("WindowEventHandlers.onunload")}}
+
Called when the user navigates away from the page.
+
+ +

Events

+ +

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

+ +
+
error
+
Fired when when a resource failed to load, or can't be used. For example, if a script has an execution error or an image can't be found or is invalid.
+ Also available via the {{domxref("GlobalEventHandlers/onerror", "onerror")}} property.
+
languagechange
+
Fired at the global scope object when the user's preferred language changes.
+ Also available via the onlanguagechange property.
+
orientationchange
+
Fired when the orientation of the device has changed.
+ Also available via the onorientationchange property.
+
devicemotion
+
Fired at a regular interval, indicating the amount of physical force of acceleration the device is receiving and the rate of rotation, if available.
+
deviceorientation
+
Fired when fresh data is available from the magnetometer orientation sensor about the current orientation of the device as compared to the Earth coordinate frame.
+
{{domxref("Document/defaultView/resize_event", "resize")}}
+
Fired when the window has been resized.
+ Also available via the onresize property.
+
{{domxref("Document/defaultView/storage_event", "storage")}}
+
Fired when a storage area (localStorage or sessionStorage) has been modified in the context of another document.
+ Also available via the onstorage property.
+
+ +

Animation events

+ +
+
animationcancel
+
Fired when an animation unexpectedly aborts.
+ Also available via the onanimationcancel property.
+
animationend
+
Fired when an animation has completed normally.
+ Also available via the onanimationend property.
+
animationiteration
+
Fired when an animation iteration has completed.
+ Also available via the onanimationiteration property.
+
animationstart
+
Fired when an animation starts.
+ Also available via the onanimationstart property.
+
+ +

Clipboard events

+ +
+
clipboardchange
+
Fired when the system clipboard content changes.
+
copy
+
Fired when the user initiates a copy action through the browser's user interface.
+ Also available via the oncopy property.
+
cut
+
Fired when the user initiates a cut action through the browser's user interface.
+ Also available via the oncut property.
+
paste
+
Fired when the user initiates a paste action through the browser's user interface.
+ Also available via the onpaste property.
+
+ +

Connection events

+ +
+
offline
+
Fired when the browser has lost access to the network and the value of navigator.onLine has switched to false.
+ Also available via the {{domxref("WindowEventHandlers.onoffline", "onoffline")}} property.
+
online
+
Fired when the browser has gained access to the network and the value of navigator.onLine has switched to true.
+ Also available via the {{domxref("WindowEventHandlers.ononline", "ononline")}} property.
+
+ +

Focus events

+ +
+
blur
+
Fired when an element has lost focus.
+ Also available via the onblur property.
+
focus
+
Fired when an element has gained focus.
+ Also available via the onfocus property
+
+ +

Gamepad events

+ +
+
gamepadconnected
+
Fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used.
+ Also available via the ongamepadconnected property.
+
gamepaddisconnected
+
Fired when the browser detects that a gamepad has been disconnected.
+ Also available via the ongamepaddisconnected property
+
+ +

History events

+ +
+
hashchange
+
Fired when the fragment identifier of the URL has changed (the part of the URL beginning with and following the # symbol).
+ Also available via the onhashchange property.
+
pagehide
+
Sent when the browser  hides the current document while in the process of switching to displaying in its palce a different document from the session's history. This happens, for example, when the user clicks the Back button or when they click the Forward button to move ahead in session history.
+ Also available through the onpagehide event handler property.
+
pageshow
+
Sent when the browser makes the document visible due to navigation tasks, including not only when the page is first loaded, but also situations such as the user navigating back to the page after having navigated to another within the same tab.
+ Also available using the onpageshow event handler property.
+
{{domxref("Document/defaultView/popstate_event", "popstate")}}
+
Fired when the active history entry changes.
+ Also available using the onpopstate event handler property.
+
+ +

Load & unload events

+ +
+
beforeunload
+
Fired when the window, the document and its resources are about to be unloaded.
+ Also available via the onbeforeunload property.
+
DOMContentLoaded
+
Fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
+
load
+
Fired when the whole page has loaded, including all dependent resources such as stylesheets images.
+ Also available via the onload property.
+
unload
+
Fired when the document or a child resource is being unloaded.
+ Also available via the onunload property.
+
+ +

Manifest events

+ +
+
appinstalled
+
Fired when the browser has successfully installed a page as an application.
+ Also available via the onappinstalled property.
+
beforeinstallprompt
+
Fired when a user is about to be prompted to install a web application.
+ Also available via the onbeforeinstallprompt property.
+
+ +

Messaging events

+ +
+
message
+
Fired when the window receives a message, for example from a call to Window.postMessage() from another browsing context.
+ Also available via the onmessage property.
+
messageerror
+
Fired when a Window object receives a message that can't be deserialized.
+ Also available via the onmessageerror property.
+
+ + + +
+
afterprint
+
Fired after the associated document has started printing or the print preview has been closed.
+ Also available via the onafterprint property.
+
beforeprint
+
Fired when the associated document is about to be printed or previewed for printing.
+ Also available via the onbeforeprint property.
+
+ +

Promise rejection events

+ +
+
rejectionhandled
+
Sent every time a JavaScript {{jsxref("Promise")}} is rejected, regardless of whether or not there is a handler in place to catch the rejection.
+ Also available through the onrejectionhandled event handler property.
+
unhandledrejection
+
Sent when a JavaScript {{jsxref("Promise")}} is rejected but there is no handler in place to catch the rejection.
+ Also available using the onunhandledrejection event handler property.
+
+ +

Transition events

+ +
+
transitioncancel
+
Fired when a CSS transition is canceled.
+ Also available via the ontransitioncancel property.
+
transitionend
+
Fired when a CSS transition has completed.
+ Also available via the ontransitionend property.
+
transitionrun
+
Fired when a CSS transition is first created.
+ Also available via the ontransitionrun property.
+
transitionstart
+
Fired when a CSS transition has actually started.
+ Also available via the ontransitionstart property.
+
+ +

WebVR events

+ +
+
vrdisplayactivate
+
Fired when a VR display becomes available to be presented to, for example if an HMD has been moved to bring it out of standby, or woken up by being put on.
+ Also available via the onvrdisplayactivate property.
+
vrdisplayblur
+
Fired when presentation to a VR display has been paused for some reason by the browser, OS, or VR hardware.
+ Also available via the onvrdisplayblur property.
+
vrdisplayconnect
+
Fired when a compatible VR display is connected to the computer.
+ Also available via the onvrdisplayconnect property.
+
vrdisplaydeactivate
+
Fired when a VR display can no longer be presented to, for example if an HMD has gone into standby or sleep mode due to a period of inactivity.
+ Also available via the onvrdisplaydeactivate property.
+
vrdisplaydisconnect
+
Fired when a compatible VR display is disconnected from the computer.
+ Also available via the onvrdisplaydisconnect property.
+
vrdisplayfocus
+
Fired when presentation to a VR display has resumed after being blurred.
+ Also available via the onvrdisplayfocus property.
+
vrdisplaypresentchange
+
fired when the presenting state of a VR display changes — i.e. goes from presenting to not presenting, or vice versa.
+ Also available via the onvrdisplaypresentchange property.
+
vrdisplaypointerrestricted
+
Fired when the VR display's pointer input is restricted to consumption via a pointerlocked element.
+ Also available via the onvrdisplaypointerrestricted property.
+
vrdisplaypointerunrestricted
+
Fired when the VR display's pointer input is no longer restricted to consumption via a pointerlocked element.
+ Also available via the onvrdisplaypointerunrestricted property.
+
+ +

Interfaces

+ +

See DOM Reference

+ +

Browser compatibility

+ + + +

{{Compat("api.Window")}}

+ +

See also

+ + diff --git a/files/hu/web/api/worker/index.html b/files/hu/web/api/worker/index.html new file mode 100644 index 0000000000..706c2b3935 --- /dev/null +++ b/files/hu/web/api/worker/index.html @@ -0,0 +1,147 @@ +--- +title: Worker +slug: Web/API/Worker +translation_of: Web/API/Worker +--- +

{{APIRef("Web Workers API")}}

+ +

The Worker interface of the Web Workers API represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread.

+ +

Workers may in turn spawn new workers as long as those workers are hosted within the same origin as the parent page (Note: nested workers are currently not implemented in Blink).  In addition workers may use XMLHttpRequest for network I/O, with the stipulation that the responseXML and channel attributes on XMLHttpRequest always return null.

+ +

Not all interfaces and functions are available to the script associated with a Worker.

+ +

In Firefox, if you want to use workers in extensions and would like to have access to js-ctypes, you should use the {{ domxref("ChromeWorker") }} object instead.

+ +

Properties

+ +

Inherits properties from its parent, {{domxref("EventTarget")}}, and implements properties from {{domxref("AbstractWorker")}}.

+ +

Event handlers

+ +
+
{{domxref("AbstractWorker.onerror")}}
+
An {{ domxref("EventListener") }} called whenever an {{domxref("ErrorEvent")}} of type error bubbles through to the worker. This is inherited from {{domxref("AbstractWorker")}}.
+
{{domxref("Worker.onmessage")}}
+
An {{ domxref("EventListener") }} called whenever a {{domxref("MessageEvent")}} of type message bubbles through the worker — i.e. when a message is sent to the parent document from the worker via {{domxref("DedicatedWorkerGlobalScope.postMessage")}}. The message is stored in the event's {{domxref("MessageEvent.data", "data")}} property.
+
+ +

Constructors

+ +
+
{{domxref("Worker.Worker", "Worker()")}}
+
Creates a dedicated web worker that executes the script at the specified URL. Workers can also be constructed using Blobs.
+
+ +

Methods

+ +

Inherits methods from its parent, {{domxref("EventTarget")}}, and implements properties from {{domxref("AbstractWorker")}}.

+ +
+
{{domxref("Worker.postMessage()")}}
+
Sends a message — which can consist of any JavaScript object — to the worker's inner scope.
+
{{domxref("Worker.terminate()")}}
+
Immediately terminates the worker. This does not offer the worker an opportunity to finish its operations; it is simply stopped at once. ServiceWorker instances do not support this method.
+
+ +

Example

+ +

The following code snippet shows creation of a {{domxref("Worker")}} object using the {{domxref("Worker.Worker", "Worker()")}} constructor and usage of the object:

+ +
var myWorker = new Worker("worker.js");
+var first = document.querySelector('#number1');
+var second = document.querySelector('#number2');
+
+first.onchange = function() {
+  myWorker.postMessage([first.value,second.value]);
+  console.log('Message posted to worker');
+}
+ +

For a full example, see ourBasic dedicated worker example (run dedicated worker).

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', "#worker", "Worker")}}{{Spec2('HTML WHATWG')}}No change from {{SpecName("Web Workers")}}.
{{SpecName('Web Workers', "#worker", "Worker")}}{{Spec2('Web Workers')}}Initial definition.
+ +

Browser compatibility

+ +

Support varies for different types of workers. See each worker type's page for specifics.

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support43.510.010.64
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)Firefox OS (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support4.43.51.0.110.011.55.1{{CompatUnknown}}
+
+ +

See also

+ + diff --git a/files/hu/web/api/xmlhttprequest/index.html b/files/hu/web/api/xmlhttprequest/index.html new file mode 100644 index 0000000000..6caf14a9ae --- /dev/null +++ b/files/hu/web/api/xmlhttprequest/index.html @@ -0,0 +1,235 @@ +--- +title: XMLHttpRequest +slug: Web/API/XMLHttpRequest +translation_of: Web/API/XMLHttpRequest +--- +
{{APIRef("XMLHttpRequest")}}
+ +
 
+ +

Az XMLHttpRequest API a szerverrel való direkt kommunikációra használható, a teljes oldal újratöltése nélkül. Ez lehetővé teszi a weboldalak bizonyos adatainak frissítését, a nélkül, hogy a felhasználónak meg kéne szakítania azt, amit éppen csinál.  Az XMLHttpRequest az Ajax alapja.

+ +

{{InheritanceDiagram}}

+ +
Történet
+ +

Az XMLHttpRequest objektumot eredetileg a Microsoft alkotta meg, később átvette a Mozilla, az Apple, és a Google is. Mára általánosan elfogadott szabvány lett a WHATWG által. A neve ellenére, az XMLHttpRequest több adattípussal képes dolgozni, nem csupán az XML-el, és a HTTP mellett más protokollokat is támogat (beleértve a file és az ftp protokollt is).

+ +

Konstruktor

+ +
+
{{domxref("XMLHttpRequest.XMLHttpRequest", "XMLHttpRequest()")}}
+
A konstruktor létrehoz egy üres XMLHttpRequest objektumot. Ez szükséges előfeltétele annak, hogy az objektum eljárásait meghívhassunk. +
  var xhr = new XMLHttpRequest();
+ 
+
+
+ +

Tulajdonságok

+ +

Az XMLHttpRequest API az {{domxref("XMLHttpRequestEventTarget")}} és az {{domxref("EventTarget")}} tulajdonságait is örökli.

+ +
+
{{domxref("XMLHttpRequest.onreadystatechange")}}
+
Ez az {{domxref("EventHandler")}} (eseménykezelő) mindig meghívódik, amikor a readyState tulajdonság értéke megváltozik, így – szükség szerint – minden állapothoz külön esemény vagy eljárás rendelhető. Az alábbi példában minden állapotváltozásról tájékoztatjuk a felhasználót: +
  xhr.onreadystatechange = function () {
+    switch(xhr.readyState) {
+      case 0: alert("A kérelem nem inicializált");
+      break;
+      case 1: alert("A kapcsolat létrejött");
+      break;
+      case 2: alert("A kérelem fogadva");
+      break;
+      case 3: alert("A kérelem feldolgozása folyamatban");
+      break;
+      default: alert("A kérelem feldolgozva, válasz kész");
+    }
+  };
+ 
+ A gyakorlatban erre azonban ritkán van szükség. Praktikusabb, ha csak a feldolgozott kérelemre érkező válaszra reagálunk (az alábbi példában kiírjuk a válasz szövegét):
+
+
  xhr.onreadystatechange = function() {
+    if (this.readyState == 4 && this.status == 200) {
+      alert(this.responseText);
+    }
+  };
+ 
+
+
{{domxref("XMLHttpRequest.readyState")}} {{readonlyinline}}
+
A kérelem állapotát jelző előjel nélküli számmal tér vissza, amely lehet: +
    +
  1. - ha a kérés nem inicializált
  2. +
  3. - ha a kapcsolat létrejött a szerverrel
  4. +
  5. - ha a kérés fogadva
  6. +
  7. - ha a kérés feldolgozása folyamatban
  8. +
  9. - ha a kérés kész, válasz kész
  10. +
+
+
{{domxref("XMLHttpRequest.response")}} {{readonlyinline}}
+
A válasz törzsét tartalmazza, melynek típusát a {{domxref("XMLHttpRequest.responseType")}} tulajdonság értéke határozza meg.
+
{{domxref("XMLHttpRequest.responseText")}} {{readonlyinline}}
+
Visszatérési értéke lehet {{domxref("DOMString")}} amely egyszerű szövegként tartalmazza a választ az elküldött kérelemre, vagy null,ha a kérelem sikertelen volt.
+
{{domxref("XMLHttpRequest.responseType")}}
+
A válasz típusát határozza meg, amely lehet: +
    +
  • üres sztring (alapértelmezett)
  • +
  • {{domxref("ArrayBuffer")}} objektum
  • +
  • {{domxref("Blob")}} objektum
  • +
  • {{domxref("Document")}}
  • +
  • JavaScript objektum (JSON)
  • +
  • {{domxref("DOMString")}}
  • +
+
+
{{domxref("XMLHttpRequest.responseURL")}} {{readonlyinline}}
+
Visszatérési értéke a válasz szerializált URL-je, vagy üres sztring, ha az URL értéke null.
+
{{domxref("XMLHttpRequest.responseXML")}} {{readonlyinline}}
+
Egy {{domxref("Document")}}-el tér vissza, amely tartalmazza a kérelemre kapott választ XML formátumban, vagy null-t, ha a kérés sikertelen, nem lehetett elküldeni, illetve a válasz nem jeleníthető meg XML formátumban. Not available in workers.
+
{{domxref("XMLHttpRequest.status")}} {{readonlyinline}}
+
A szerver által a kérelemre küldött válasz HTTP státusz-kódját adja vissza, előjel nélküli, háromjegyű szám formátumban (pl. 200, ha a kérelem elfogadva, 404, ha a kért erőforrás nem található a szerveren - bővebben a HTTP státusz kódokról itt).
+
{{domxref("XMLHttpRequest.statusText")}} {{readonlyinline}}
+
A szerver által küldött válasz státusz-kódjához tartozó szöveggel (response message) tér vissza (pl. "200 OK", siker esetén, bővebben lásd fent).
+
+ +
+

Megjegyzés: a HTTP/2 specifikáció alapján (8.1.2.4 Response Pseudo-Header Fields) HTTP/2 válaszokat egy :status pseudo-header mező határozza meg, amely tartalmazza a HTTP státusz kód mezőt is. A HTTP/2 nem határozza meg, hogy a verzió és más kifejezések hogy jelenjenek meg a válasz HTTP/1.1 állapot-sorában.

+
+ +
+
{{domxref("XMLHttpRequest.timeout")}}
+
Egy előjel nélküli egész szám, amely megadja a várakozási időt (ezredmásodpercben) a kapcsolat automatikus lezárásig.
+
{{domxref("XMLHttpRequestEventTarget.ontimeout")}}
+
Ez egy {{domxref("EventHandler")}} (eseménykezelő), amely a {{domxref("XMLHttpRequest.timeout")}} tulajdonságban megadott idő túllépése esetén mindig meghívódik. {{gecko_minversion_inline("12.0")}} +
xhr.timeout = 4000; //Időtúllépés beállítása 4 másodpercre
+xhr.ontimeout = function () { alert("Időtúllépés!!!"); }
+/* Időtúllépés esetén az eseménykezelő egy névtelen
+ függvényt hív meg, amely egy felugró ablakban tájékoztatja
+ a felhasználót az időtúllépésről */
+ 
+
+
{{domxref("XMLHttpRequest.upload")}} {{readonlyinline}}
+
Minden XMLHttpRequest objektumhoz rendelkezik egy {{domxref("XMLHttpRequestUpload")}} objektummal, amely adatátviteli információk összegyűjtésére használható, amikor az adatok átkerülnek a kiszolgálóra. Az upload tulajdonság ezt adja vissza.
+
{{domxref("XMLHttpRequest.withCredentials")}}
+
Logikai érték ({{domxref("Boolean")}}), that indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers.
+
+ +

Nem szabványos tulajdonságok

+ +
+
{{domxref("XMLHttpRequest.channel")}}{{ReadOnlyInline}}
+
Is a {{Interface("nsIChannel")}}. The channel used by the object when performing the request.
+
{{domxref("XMLHttpRequest.mozAnon")}}{{ReadOnlyInline}}
+
Logikai érték ({{domxref("Boolean")}}). Ha értéke igaz (true), akkor a kérelem sütik és azonosító fejlécek nélkül lesz elküldve.
+
{{domxref("XMLHttpRequest.mozSystem")}}{{ReadOnlyInline}}
+
Logikai érték ({{domxref("Boolean")}}). If true, the same origin policy will not be enforced on the request.
+
{{domxref("XMLHttpRequest.mozBackgroundRequest")}}
+
Logikai érték ({{domxref("Boolean")}}). It indicates whether or not the object represents a background service request.
+
{{domxref("XMLHttpRequest.mozResponseArrayBuffer")}}{{gecko_minversion_inline("2.0")}} {{obsolete_inline("6")}} {{ReadOnlyInline}}
+
Egy ArrayBuffer  objektum. A válasz a kérelemre egy JavaScript-stílusú tömb lesz.
+
{{domxref("XMLHttpRequest.multipart")}}{{obsolete_inline("22")}}
+
This Gecko-only feature, a boolean, was removed in Firefox/Gecko 22. Please use Server-Sent Events, Web Sockets, or responseText from progress events instead.
+
+ +

Eseménykezelők

+ +

Az onreadystatechange az XMLHttpRequest objektum olyan tulajdonsága, amely mindig meghívódik, amikor a readyState tulajdonság értéke megváltozik. Ezt az eseménykezelőt az összes böngésző támogatja.

+ +

A különböző böngészők által támogatott eseménykezelők száma egyre nagyobb (onload, onerror, onprogress, stb.). Ezeket a Firefox is mind támogatja. További információk az nsIXMLHttpRequestEventTarget objektumról és az XMLHttpRequest használatáról.

+ +

Az újabb böngészők (mint a Firefox is), támogatják az XMLHttpRequest események szabványos addEventListener általi figyelését. Az API ezen felül bekapcsolt (on*) értékre állítja a tulajdonságokat a kezelő függvényben.

+ +

Metódusok

+ +
+
{{domxref("XMLHttpRequest.abort()")}}
+
Megszakítja az aktuális kérelmet.
+
{{domxref("XMLHttpRequest.getAllResponseHeaders()")}}
+
A válasz összes fejlécét adja vissza egyszerű szövegként, \r\n (CRLF) sorvég karakterekkel elválasztva. Ha nem érkezett válasz a kérelemre, null értékkel tér vissza.
+
{{domxref("XMLHttpRequest.getResponseHeader()")}}
+
A paraméterül kapott fejléc szöveges értékével tér vissza siker esetén, vagy null-al, ha nem érkezett válasz a kérelemre vagy a kért fejléc nem található a válaszban. +
  xhr.getResponseHeader("Content-Type");
+  
+
+
{{domxref("XMLHttpRequest.open()")}}
+
Inicializálja az elküldendő kérelmet. Beállítja a kérelem továbbítására használt metódust (ez lehet post vagy get), a cél URL-t (a kérelmet fogadó/feldolgozó távoli állomány elérési útját) és az aszinkron kapcsolót (true = aszinkron[alapértelmezett], false = szinkron). Opcionálisan megadható paraméterek: felhasználónév és jelszó. Ezt az eljárást JavaScript kódból lehet meghívni, natív kódból az openRequest() eljárás ajánlott helyette. +
  xhr.open("POST","feldolgoz.php", true);
+  
+
+
{{domxref("XMLHttpRequest.overrideMimeType()")}}
+
Felülbírálja a kiszolgáló által visszaadott MIME típust.
+
{{domxref("XMLHttpRequest.send()")}}
+
Kérelem elküldése. Ha a kérelem aszinkron (ez az alapértelmezett), az eljárás visszatér, amint a kérelem el lett küldve.
+
{{domxref("XMLHttpRequest.setRequestHeader()")}}
+
A post metódussal elküldött HTTP kérelem fejlécét állítja be. Két bemeneti paramétert vár: a fejléc nevét és értékét. A setRequestHeader() eljárást az open() után, de a send() előtt kell meghívni. +
  xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+  
+
+
+ +

Nem szabványos metódusok

+ +
+
{{domxref("XMLHttpRequest.init()")}}
+
C++ kódból történő használatra inicializálja az objektumot.
+
+ +
Figyelmeztetés: Ezt a metódust nem szabad JavaScript-ből meghívni.
+ +
+
{{domxref("XMLHttpRequest.openRequest()")}}
+
Inicializálja a kérelmet. Ezt az eljárást natív kódból lehet használni a kérelem inicializálására, az open() helyett. További részletek az open() leírásában.
+
{{domxref("XMLHttpRequest.sendAsBinary()")}}{{deprecated_inline()}}
+
A send() egy változata, ami bináris adatokat küld.
+
+ +

Specifikációk

+ + + + + + + + + + + + + + +
SpecifikációÁllapotMegjegyzés
{{SpecName('XMLHttpRequest')}}{{Spec2('XMLHttpRequest')}}Hatályos szabvány, aktuális változat
+ +

Böngésző támogatottság

+ + + +
{{Compat("api.XMLHttpRequest")}}
+ +

Hivatkozások

+ + diff --git a/files/hu/web/api/xmlhttprequest/xmlhttprequest_hasznalata/index.html b/files/hu/web/api/xmlhttprequest/xmlhttprequest_hasznalata/index.html new file mode 100644 index 0000000000..14559667cc --- /dev/null +++ b/files/hu/web/api/xmlhttprequest/xmlhttprequest_hasznalata/index.html @@ -0,0 +1,791 @@ +--- +title: Az XMLHttpRequest használata +slug: Web/API/XMLHttpRequest/XMLHttpRequest_hasznalata +tags: + - AJAX + - HTTP + - XMLHttpRequest +translation_of: Web/API/XMLHttpRequest/Using_XMLHttpRequest +--- +
{{APIRef("XMLHttpRequest")}}
+ +

Ebben az útmutatóban azt fogjuk körüljárni, hogy miként használhatjuk az {{domxref("XMLHttpRequest")}} objektumot HTTP kérelmek küldésére, annak érdekében, hogy adatokat cserélhessünk a webhely és a szerver között.

+ +

Egy új HTTP kérelem elküldéséhez először hozzunk létre egy új XMLHttpRequest objektumot, nyissuk meg az URL-t, majd küldjük el a kérelmet. Az adatátvitel befejezése után, objektumunk hasznos információkkal szolgálhat, mint a válasz törzs vagy az eredmény HTTP státusz kódja.

+ +
function reqListener () {
+  console.log(this.responseText);
+}
+
+var oReq = new XMLHttpRequest();
+oReq.addEventListener("load", reqListener);
+oReq.open("GET", "http://www.example.org/example.txt");
+oReq.send();
+ +

Kérelem típusok

+ +

A request made via XMLHttpRequest can fetch the data in one of two ways, asynchronously or synchronously. The type of request is dictated by the optional async argument (the third argument) that is set on the {{domxref("XMLHttpRequest.open()")}} method. If this argument is true or not specified, the XMLHttpRequest is processed asynchronously, otherwise the process is handled synchronously. A detailed discussion and demonstrations of these two types of requests can be found on the synchronous and asynchronous requests page. Do not use synchronous requests outside Web Workers.

+ +
Note: Starting with Gecko 30.0 {{ geckoRelease("30.0") }}, synchronous requests on the main thread have been deprecated due to the negative effects to the user experience.
+ +
Note: The constructor function XMLHttpRequest isn't limited to only XML documents. It starts with "XML" because when it was created the main format that was originally used for Asynchronous Data Exchange were XML
+ +

Válasz kezelés

+ +

There are several types of response attributes defined by the living standard specification for the {{domxref("XMLHttpRequest.XMLHttpRequest", "XMLHttpRequest()")}} constructor. These tell the client making the XMLHttpRequest important information about the status of the response. Some cases where dealing with non-text response types may involve some manipulation and analysis are outlined in the following sections.

+ +

Analyzing and manipulating the responseXML property

+ +

If you use XMLHttpRequest to get the content of a remote XML document, the {{domxref("XMLHttpRequest.responseXML", "responseXML")}} property will be a DOM object containing a parsed XML document. This could prove difficult to manipulate and analyze. There are four primary ways of analyzing this XML document:

+ +
    +
  1. Using XPath to address (or point to) parts of it.
  2. +
  3. Manually Parsing and serializing XML to strings or objects.
  4. +
  5. Using {{domxref("XMLSerializer")}} to serialize DOM trees to strings or to files.
  6. +
  7. {{jsxref("RegExp")}} can be used if you always know the content of the XML document beforehand. You might want to remove line breaks, if you use RegExp to scan with regard to line breaks. However, this method is a "last resort" since if the XML code changes slightly, the method will likely fail.
  8. +
+ +
+

Note: XMLHttpRequest can now interpret HTML for you using the {{domxref("XMLHttpRequest.responseXML", "responseXML")}} property. Read the article about HTML in XMLHttpRequest to learn how to do this.

+
+ +

Processing a responseText property containing an HTML document

+ +

If you use XMLHttpRequest to get the content of a remote HTML webpage, the {{domxref("XMLHttpRequest.responseText", "responseText")}} property is a string containing the raw HTML. This could prove difficult to manipulate and analyze. There are three primary ways to analyze and parse this raw HTML string:

+ +
    +
  1. Use the XMLHttpRequest.responseXML property as covered in the article HTML in XMLHttpRequest.
  2. +
  3. Inject the content into the body of a document fragment via fragment.body.innerHTML and traverse the DOM of the fragment.
  4. +
  5. {{jsxref("RegExp")}} can be used if you always know the content of the HTML responseText beforehand. You might want to remove line breaks, if you use RegExp to scan with regard to linebreaks. However, this method is a "last resort" since if the HTML code changes slightly, the method will likely fail.
  6. +
+ +

Bináris adatok kezelése

+ +

Although {{domxref("XMLHttpRequest")}} is most commonly used to send and receive textual data, it can be used to send and receive binary content. There are several well tested methods for coercing the response of an XMLHttpRequest into sending binary data. These involve utilizing the {{domxref("XMLHttpRequest.overrideMimeType", "overrideMimeType()")}} method on the XMLHttpRequest object and is a workable solution.

+ +
var oReq = new XMLHttpRequest();
+oReq.open("GET", url);
+// retrieve data unprocessed as a binary string
+oReq.overrideMimeType("text/plain; charset=x-user-defined");
+/* ... */
+
+ +

However, more modern techniques are available, since the {{domxref("XMLHttpRequest.responseType", "responseType")}} attribute now supports a number of additional content types, which makes sending and receiving binary data much easier.

+ +

For example, consider this snippet, which uses the responseType of "arraybuffer" to fetch the remote content into a {{jsxref("ArrayBuffer")}} object, which stores the raw binary data.

+ +
var oReq = new XMLHttpRequest();
+
+oReq.onload = function(e) {
+  var arraybuffer = oReq.response; // not responseText
+  /* ... */
+}
+oReq.open("GET", url);
+oReq.responseType = "arraybuffer";
+oReq.send();
+ +

For more examples check out the Sending and Receiving Binary Data page

+ +

Folyamatok nyomonkövetése

+ +

XMLHttpRequest provides the ability to listen to various events that can occur while the request is being processed. This includes periodic progress notifications, error notifications, and so forth.

+ +

Support for DOM {{event("progress")}} event monitoring of XMLHttpRequest transfers follows the specification for progress events: these events implement the {{domxref("ProgressEvent")}} interface. The actual events you can monitor to determine the state of an ongoing transfer are:

+ +
+
{{event("progress")}}
+
The amount of data that has been retrieved has changed.
+
{{event("load")}}
+
The transfer is complete; all data is now in the response
+
+ +
var oReq = new XMLHttpRequest();
+
+oReq.addEventListener("progress", updateProgress);
+oReq.addEventListener("load", transferComplete);
+oReq.addEventListener("error", transferFailed);
+oReq.addEventListener("abort", transferCanceled);
+
+oReq.open();
+
+// ...
+
+// progress on transfers from the server to the client (downloads)
+function updateProgress (oEvent) {
+  if (oEvent.lengthComputable) {
+    var percentComplete = oEvent.loaded / oEvent.total * 100;
+    // ...
+  } else {
+    // Unable to compute progress information since the total size is unknown
+  }
+}
+
+function transferComplete(evt) {
+  console.log("The transfer is complete.");
+}
+
+function transferFailed(evt) {
+  console.log("An error occurred while transferring the file.");
+}
+
+function transferCanceled(evt) {
+  console.log("The transfer has been canceled by the user.");
+}
+ +

Lines 3-6 add event listeners for the various events that are sent while performing a data transfer using XMLHttpRequest.

+ +
Note: You need to add the event listeners before calling open() on the request. Otherwise the progress events will not fire.
+ +

The progress event handler, specified by the updateProgress() function in this example, receives the total number of bytes to transfer as well as the number of bytes transferred so far in the event's total and loaded fields. However, if the lengthComputable field is false, the total length is not known and will be zero.

+ +

Progress events exist for both download and upload transfers. The download events are fired on the XMLHttpRequest object itself, as shown in the above sample. The upload events are fired on the XMLHttpRequest.upload object, as shown below:

+ +
var oReq = new XMLHttpRequest();
+
+oReq.upload.addEventListener("progress", updateProgress);
+oReq.upload.addEventListener("load", transferComplete);
+oReq.upload.addEventListener("error", transferFailed);
+oReq.upload.addEventListener("abort", transferCanceled);
+
+oReq.open();
+
+ +
Note: Progress events are not available for the file: protocol.
+ +
+

Note: Starting in {{Gecko("9.0")}}, progress events can now be relied upon to come in for every chunk of data received, including the last chunk in cases in which the last packet is received and the connection closed before the progress event is fired. In this case, the progress event is automatically fired when the load event occurs for that packet. This lets you now reliably monitor progress by only watching the "progress" event.

+
+ +
+

Note: As of {{Gecko("12.0")}}, if your progress event is called with a responseType of "moz-blob", the value of response is a {{domxref("Blob")}} containing the data received so far.

+
+ +

One can also detect all three load-ending conditions (abort, load, or error) using the loadend event:

+ +
req.addEventListener("loadend", loadEnd);
+
+function loadEnd(e) {
+  console.log("The transfer finished (although we don't know if it succeeded or not).");
+}
+
+ +

Note there is no way to be certain, from the information received by the loadend event, as to which condition caused the operation to terminate; however, you can use this to handle tasks that need to be performed in all end-of-transfer scenarios.

+ +

Űrlapok küldése és állományok feltöltése

+ +

Instances of XMLHttpRequest can be used to submit forms in two ways:

+ + + +

Using the FormData API is the simplest and fastest, but has the disadvantage that data collected can not be stringified.
+ Using only AJAX is more complex, but typically more flexible and powerful.

+ +

Using nothing but XMLHttpRequest

+ +

Submitting forms without the FormData API does not require other APIs for most use cases. The only case where you need an additional API is if you want to upload one or more files, where you use the {{domxref("FileReader")}} API.

+ +

A brief introduction to the submit methods

+ +

An html {{ HTMLElement("form") }} can be sent in four ways:

+ + + +

Now, consider the submission of a form containing only two fields, named foo and baz. If you are using the POST method the server will receive a string similar to one of the following three examples, depending on the encoding type you are using:

+ + + +

However, if you are using the GET method, a string like the following will be simply added to the URL:

+ +
?foo=bar&baz=The%20first%20line.%0AThe%20second%20line.
+ +

A little vanilla framework

+ +

All these effects are done automatically by the web browser whenever you submit a {{HTMLElement("form")}}. If you want to perform the same effects using JavaScript you have to instruct the interpreter about everything. Therefore, how to send forms in pure AJAX is too complex to be explained here in detail. For this reason, here we place a complete (yet didactic) framework, able to use all four ways to submit, and to upload files:

+ +
+
<!doctype html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Sending forms with pure AJAX &ndash; MDN</title>
+<script type="text/javascript">
+
+"use strict";
+
+/*\
+|*|
+|*|  :: XMLHttpRequest.prototype.sendAsBinary() Polyfill ::
+|*|
+|*|  https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#sendAsBinary()
+\*/
+
+if (!XMLHttpRequest.prototype.sendAsBinary) {
+  XMLHttpRequest.prototype.sendAsBinary = function(sData) {
+    var nBytes = sData.length, ui8Data = new Uint8Array(nBytes);
+    for (var nIdx = 0; nIdx < nBytes; nIdx++) {
+      ui8Data[nIdx] = sData.charCodeAt(nIdx) & 0xff;
+    }
+    /* send as ArrayBufferView...: */
+    this.send(ui8Data);
+    /* ...or as ArrayBuffer (legacy)...: this.send(ui8Data.buffer); */
+  };
+}
+
+/*\
+|*|
+|*|  :: AJAX Form Submit Framework ::
+|*|
+|*|  https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest
+|*|
+|*|  This framework is released under the GNU Public License, version 3 or later.
+|*|  https://www.gnu.org/licenses/gpl-3.0-standalone.html
+|*|
+|*|  Syntax:
+|*|
+|*|   AJAXSubmit(HTMLFormElement);
+\*/
+
+var AJAXSubmit = (function () {
+
+  function ajaxSuccess () {
+    /* console.log("AJAXSubmit - Success!"); */
+    console.log(this.responseText);
+    /* you can get the serialized data through the "submittedData" custom property: */
+    /* console.log(JSON.stringify(this.submittedData)); */
+  }
+
+  function submitData (oData) {
+    /* the AJAX request... */
+    var oAjaxReq = new XMLHttpRequest();
+    oAjaxReq.submittedData = oData;
+    oAjaxReq.onload = ajaxSuccess;
+    if (oData.technique === 0) {
+      /* method is GET */
+      oAjaxReq.open("get", oData.receiver.replace(/(?:\?.*)?$/,
+          oData.segments.length > 0 ? "?" + oData.segments.join("&") : ""), true);
+      oAjaxReq.send(null);
+    } else {
+      /* method is POST */
+      oAjaxReq.open("post", oData.receiver, true);
+      if (oData.technique === 3) {
+        /* enctype is multipart/form-data */
+        var sBoundary = "---------------------------" + Date.now().toString(16);
+        oAjaxReq.setRequestHeader("Content-Type", "multipart\/form-data; boundary=" + sBoundary);
+        oAjaxReq.sendAsBinary("--" + sBoundary + "\r\n" +
+            oData.segments.join("--" + sBoundary + "\r\n") + "--" + sBoundary + "--\r\n");
+      } else {
+        /* enctype is application/x-www-form-urlencoded or text/plain */
+        oAjaxReq.setRequestHeader("Content-Type", oData.contentType);
+        oAjaxReq.send(oData.segments.join(oData.technique === 2 ? "\r\n" : "&"));
+      }
+    }
+  }
+
+  function processStatus (oData) {
+    if (oData.status > 0) { return; }
+    /* the form is now totally serialized! do something before sending it to the server... */
+    /* doSomething(oData); */
+    /* console.log("AJAXSubmit - The form is now serialized. Submitting..."); */
+    submitData (oData);
+  }
+
+  function pushSegment (oFREvt) {
+    this.owner.segments[this.segmentIdx] += oFREvt.target.result + "\r\n";
+    this.owner.status--;
+    processStatus(this.owner);
+  }
+
+  function plainEscape (sText) {
+    /* How should I treat a text/plain form encoding?
+       What characters are not allowed? this is what I suppose...: */
+    /* "4\3\7 - Einstein said E=mc2" ----> "4\\3\\7\ -\ Einstein\ said\ E\=mc2" */
+    return sText.replace(/[\s\=\\]/g, "\\$&");
+  }
+
+  function SubmitRequest (oTarget) {
+    var nFile, sFieldType, oField, oSegmReq, oFile, bIsPost = oTarget.method.toLowerCase() === "post";
+    /* console.log("AJAXSubmit - Serializing form..."); */
+    this.contentType = bIsPost && oTarget.enctype ? oTarget.enctype : "application\/x-www-form-urlencoded";
+    this.technique = bIsPost ?
+        this.contentType === "multipart\/form-data" ? 3 : this.contentType === "text\/plain" ? 2 : 1 : 0;
+    this.receiver = oTarget.action;
+    this.status = 0;
+    this.segments = [];
+    var fFilter = this.technique === 2 ? plainEscape : escape;
+    for (var nItem = 0; nItem < oTarget.elements.length; nItem++) {
+      oField = oTarget.elements[nItem];
+      if (!oField.hasAttribute("name")) { continue; }
+      sFieldType = oField.nodeName.toUpperCase() === "INPUT" ? oField.getAttribute("type").toUpperCase() : "TEXT";
+      if (sFieldType === "FILE" && oField.files.length > 0) {
+        if (this.technique === 3) {
+          /* enctype is multipart/form-data */
+          for (nFile = 0; nFile < oField.files.length; nFile++) {
+            oFile = oField.files[nFile];
+            oSegmReq = new FileReader();
+            /* (custom properties:) */
+            oSegmReq.segmentIdx = this.segments.length;
+            oSegmReq.owner = this;
+            /* (end of custom properties) */
+            oSegmReq.onload = pushSegment;
+            this.segments.push("Content-Disposition: form-data; name=\"" +
+                oField.name + "\"; filename=\"" + oFile.name +
+                "\"\r\nContent-Type: " + oFile.type + "\r\n\r\n");
+            this.status++;
+            oSegmReq.readAsBinaryString(oFile);
+          }
+        } else {
+          /* enctype is application/x-www-form-urlencoded or text/plain or
+             method is GET: files will not be sent! */
+          for (nFile = 0; nFile < oField.files.length;
+              this.segments.push(fFilter(oField.name) + "=" + fFilter(oField.files[nFile++].name)));
+        }
+      } else if ((sFieldType !== "RADIO" && sFieldType !== "CHECKBOX") || oField.checked) {
+        /* NOTE: this will submit _all_ submit buttons. Detecting the correct one is non-trivial. */
+        /* field type is not FILE or is FILE but is empty */
+        this.segments.push(
+          this.technique === 3 ? /* enctype is multipart/form-data */
+            "Content-Disposition: form-data; name=\"" + oField.name + "\"\r\n\r\n" + oField.value + "\r\n"
+          : /* enctype is application/x-www-form-urlencoded or text/plain or method is GET */
+            fFilter(oField.name) + "=" + fFilter(oField.value)
+        );
+      }
+    }
+    processStatus(this);
+  }
+
+  return function (oFormElement) {
+    if (!oFormElement.action) { return; }
+    new SubmitRequest(oFormElement);
+  };
+
+})();
+
+</script>
+</head>
+<body>
+
+<h1>Sending forms with pure AJAX</h1>
+
+<h2>Using the GET method</h2>
+
+<form action="register.php" method="get" onsubmit="AJAXSubmit(this); return false;">
+  <fieldset>
+    <legend>Registration example</legend>
+    <p>
+      First name: <input type="text" name="firstname" /><br />
+      Last name: <input type="text" name="lastname" />
+    </p>
+    <p>
+      <input type="submit" value="Submit" />
+    </p>
+  </fieldset>
+</form>
+
+<h2>Using the POST method</h2>
+<h3>Enctype: application/x-www-form-urlencoded (default)</h3>
+
+<form action="register.php" method="post" onsubmit="AJAXSubmit(this); return false;">
+  <fieldset>
+    <legend>Registration example</legend>
+    <p>
+      First name: <input type="text" name="firstname" /><br />
+      Last name: <input type="text" name="lastname" />
+    </p>
+    <p>
+      <input type="submit" value="Submit" />
+    </p>
+  </fieldset>
+</form>
+
+<h3>Enctype: text/plain</h3>
+
+<form action="register.php" method="post" enctype="text/plain"
+    onsubmit="AJAXSubmit(this); return false;">
+  <fieldset>
+    <legend>Registration example</legend>
+    <p>
+      Your name: <input type="text" name="user" />
+    </p>
+    <p>
+      Your message:<br />
+      <textarea name="message" cols="40" rows="8"></textarea>
+    </p>
+    <p>
+      <input type="submit" value="Submit" />
+    </p>
+  </fieldset>
+</form>
+
+<h3>Enctype: multipart/form-data</h3>
+
+<form action="register.php" method="post" enctype="multipart/form-data"
+    onsubmit="AJAXSubmit(this); return false;">
+  <fieldset>
+    <legend>Upload example</legend>
+    <p>
+      First name: <input type="text" name="firstname" /><br />
+      Last name: <input type="text" name="lastname" /><br />
+      Sex:
+      <input id="sex_male" type="radio" name="sex" value="male" />
+      <label for="sex_male">Male</label>
+      <input id="sex_female" type="radio" name="sex" value="female" />
+      <label for="sex_female">Female</label><br />
+      Password: <input type="password" name="secret" /><br />
+      What do you prefer:
+      <select name="image_type">
+        <option>Books</option>
+        <option>Cinema</option>
+        <option>TV</option>
+      </select>
+    </p>
+    <p>
+      Post your photos:
+      <input type="file" multiple name="photos[]">
+    </p>
+    <p>
+      <input id="vehicle_bike" type="checkbox" name="vehicle[]" value="Bike" />
+      <label for="vehicle_bike">I have a bike</label><br />
+      <input id="vehicle_car" type="checkbox" name="vehicle[]" value="Car" />
+      <label for="vehicle_car">I have a car</label>
+    </p>
+    <p>
+      Describe yourself:<br />
+      <textarea name="description" cols="50" rows="8"></textarea>
+    </p>
+    <p>
+      <input type="submit" value="Submit" />
+    </p>
+  </fieldset>
+</form>
+
+</body>
+</html>
+
+ +

To test this, create a page named register.php (which is the action attribute of these sample forms), and put the following minimalistic content:

+ +
<?php
+/* register.php */
+
+header("Content-type: text/plain");
+
+/*
+NOTE: You should never use `print_r()` in production scripts, or
+otherwise output client-submitted data without sanitizing it first.
+Failing to sanitize can lead to cross-site scripting vulnerabilities.
+*/
+
+echo ":: data received via GET ::\n\n";
+print_r($_GET);
+
+echo "\n\n:: Data received via POST ::\n\n";
+print_r($_POST);
+
+echo "\n\n:: Data received as \"raw\" (text/plain encoding) ::\n\n";
+if (isset($HTTP_RAW_POST_DATA)) { echo $HTTP_RAW_POST_DATA; }
+
+echo "\n\n:: Files received ::\n\n";
+print_r($_FILES);
+
+
+ +

The syntax to activate this script is simply:

+ +
AJAXSubmit(myForm);
+ +
Note: This framework uses the {{domxref("FileReader")}} API to transmit file uploads. This is a recent API and is not implemented in IE9 or below. For this reason, the AJAX-only upload is considered an experimental technique. If you do not need to upload binary files, this framework works fine in most browsers.
+ +
Note: The best way to send binary content is via {{jsxref("ArrayBuffer", "ArrayBuffers")}} or {{domxref("Blob", "Blobs")}} in conjuncton with the {{domxref("XMLHttpRequest.send()", "send()")}} method and possibly the {{domxref("FileReader.readAsArrayBuffer()", "readAsArrayBuffer()")}} method of the FileReader API. But, since the aim of this script is to work with a stringifiable raw data, we used the {{domxref("XMLHttpRequest.sendAsBinary()", "sendAsBinary()")}} method in conjunction with the {{domxref("FileReader.readAsBinaryString()", "readAsBinaryString()")}} method of the FileReader API. As such, the above script makes sense only when you are dealing with small files. If you do not intend to upload binary content, consider instead using the FormData API.
+ +
Note: The non-standard sendAsBinary method is considered deprecated as of Gecko 31 {{geckoRelease(31)}} and will be removed soon. The standard send(Blob data) method can be used instead.
+ +

Using FormData objects

+ +

The {{domxref("XMLHttpRequest.FormData", "FormData")}} constructor lets you compile a set of key/value pairs to send using XMLHttpRequest. Its primary use is in sending form data, but can also be used independently from a form in order to transmit user keyed data. The transmitted data is in the same format the form's submit() method uses to send data, if the form's encoding type were set to "multipart/form-data". FormData objects can be utilized in a number of ways with an XMLHttpRequest. For examples, and explanations of how one can utilize FormData with XMLHttpRequests, see the Using FormData Objects page. For didactic purposes here is a translation of the previous example transformed to use the FormData API. Note the brevity of the code:

+ +
+
<!doctype html>
+<html>
+<head>
+<meta http-equiv="Content-Type" charset="UTF-8" />
+<title>Sending forms with FormData &ndash; MDN</title>
+<script>
+"use strict";
+
+function ajaxSuccess () {
+  console.log(this.responseText);
+}
+
+function AJAXSubmit (oFormElement) {
+  if (!oFormElement.action) { return; }
+  var oReq = new XMLHttpRequest();
+  oReq.onload = ajaxSuccess;
+  if (oFormElement.method.toLowerCase() === "post") {
+    oReq.open("post", oFormElement.action);
+    oReq.send(new FormData(oFormElement));
+  } else {
+    var oField, sFieldType, nFile, sSearch = "";
+    for (var nItem = 0; nItem < oFormElement.elements.length; nItem++) {
+      oField = oFormElement.elements[nItem];
+      if (!oField.hasAttribute("name")) { continue; }
+      sFieldType = oField.nodeName.toUpperCase() === "INPUT" ?
+          oField.getAttribute("type").toUpperCase() : "TEXT";
+      if (sFieldType === "FILE") {
+        for (nFile = 0; nFile < oField.files.length;
+            sSearch += "&" + escape(oField.name) + "=" + escape(oField.files[nFile++].name));
+      } else if ((sFieldType !== "RADIO" && sFieldType !== "CHECKBOX") || oField.checked) {
+        sSearch += "&" + escape(oField.name) + "=" + escape(oField.value);
+      }
+    }
+    oReq.open("get", oFormElement.action.replace(/(?:\?.*)?$/, sSearch.replace(/^&/, "?")), true);
+    oReq.send(null);
+  }
+}
+</script>
+</head>
+<body>
+
+<h1>Sending forms with FormData</h1>
+
+<h2>Using the GET method</h2>
+
+<form action="register.php" method="get" onsubmit="AJAXSubmit(this); return false;">
+  <fieldset>
+    <legend>Registration example</legend>
+    <p>
+      First name: <input type="text" name="firstname" /><br />
+      Last name: <input type="text" name="lastname" />
+    </p>
+    <p>
+      <input type="submit" value="Submit" />
+    </p>
+  </fieldset>
+</form>
+
+<h2>Using the POST method</h2>
+<h3>Enctype: application/x-www-form-urlencoded (default)</h3>
+
+<form action="register.php" method="post" onsubmit="AJAXSubmit(this); return false;">
+  <fieldset>
+    <legend>Registration example</legend>
+    <p>
+      First name: <input type="text" name="firstname" /><br />
+      Last name: <input type="text" name="lastname" />
+    </p>
+    <p>
+      <input type="submit" value="Submit" />
+    </p>
+  </fieldset>
+</form>
+
+<h3>Enctype: text/plain</h3>
+
+<p>The text/plain encoding is not supported by the FormData API.</p>
+
+<h3>Enctype: multipart/form-data</h3>
+
+<form action="register.php" method="post" enctype="multipart/form-data"
+    onsubmit="AJAXSubmit(this); return false;">
+  <fieldset>
+    <legend>Upload example</legend>
+    <p>
+      First name: <input type="text" name="firstname" /><br />
+      Last name: <input type="text" name="lastname" /><br />
+      Sex:
+      <input id="sex_male" type="radio" name="sex" value="male" />
+      <label for="sex_male">Male</label>
+      <input id="sex_female" type="radio" name="sex" value="female" />
+      <label for="sex_female">Female</label><br />
+      Password: <input type="password" name="secret" /><br />
+      What do you prefer:
+      <select name="image_type">
+        <option>Books</option>
+        <option>Cinema</option>
+        <option>TV</option>
+      </select>
+    </p>
+    <p>
+      Post your photos:
+      <input type="file" multiple name="photos[]">
+    </p>
+    <p>
+      <input id="vehicle_bike" type="checkbox" name="vehicle[]" value="Bike" />
+      <label for="vehicle_bike">I have a bike</label><br />
+      <input id="vehicle_car" type="checkbox" name="vehicle[]" value="Car" />
+      <label for="vehicle_car">I have a car</label>
+    </p>
+    <p>
+      Describe yourself:<br />
+      <textarea name="description" cols="50" rows="8"></textarea>
+    </p>
+    <p>
+      <input type="submit" value="Submit" />
+    </p>
+  </fieldset>
+</form>
+</body>
+</html>
+
+ +
Note: As we said, {{domxref("FormData")}} objects are not stringifiable objects. If you want to stringify a submitted data, use the previous pure-AJAX example. Note also that, although in this example there are some file {{ HTMLElement("input") }} fields, when you submit a form through the FormData API you do not need to use the {{domxref("FileReader")}} API also: files are automatically loaded and uploaded.
+ +

Utolsó módosítás dátuma

+ +
function getHeaderTime () {
+  console.log(this.getResponseHeader("Last-Modified"));  /* A valid GMTString date or null */
+}
+
+var oReq = new XMLHttpRequest();
+oReq.open("HEAD" /* use HEAD if you only need the headers! */, "yourpage.html");
+oReq.onload = getHeaderTime;
+oReq.send();
+ +

Do something when last modified date changes

+ +

Let's create two functions:

+ +
function getHeaderTime () {
+  var nLastVisit = parseFloat(window.localStorage.getItem('lm_' + this.filepath));
+  var nLastModif = Date.parse(this.getResponseHeader("Last-Modified"));
+
+  if (isNaN(nLastVisit) || nLastModif > nLastVisit) {
+    window.localStorage.setItem('lm_' + this.filepath, Date.now());
+    isFinite(nLastVisit) && this.callback(nLastModif, nLastVisit);
+  }
+}
+
+function ifHasChanged(sURL, fCallback) {
+  var oReq = new XMLHttpRequest();
+  oReq.open("HEAD" /* use HEAD - we only need the headers! */, sURL);
+  oReq.callback = fCallback;
+  oReq.filepath = sURL;
+  oReq.onload = getHeaderTime;
+  oReq.send();
+}
+ +

And to test:

+ +
/* Let's test the file "yourpage.html"... */
+
+ifHasChanged("yourpage.html", function (nModif, nVisit) {
+  console.log("The page '" + this.filepath + "' has been changed on " + (new Date(nModif)).toLocaleString() + "!");
+});
+ +

If you want to know if the current page has changed, please read the article about {{domxref("document.lastModified")}}.

+ +

Webhelyközi XMLHttpRequest

+ +

Modern browsers support cross-site requests by implementing the Cross-Origin Resource Sharing (CORS) standard. As long as the server is configured to allow requests from your web application's origin, XMLHttpRequest will work. Otherwise, an INVALID_ACCESS_ERR exception is thrown.

+ +

Gyorsítótár megkerülése

+ +

A cross-browser compatible approach to bypassing the cache is appending a timestamp to the URL, being sure to include a "?" or "&" as appropriate. For example:

+ +
http://foo.com/bar.html -> http://foo.com/bar.html?12345
+http://foo.com/bar.html?foobar=baz -> http://foo.com/bar.html?foobar=baz&12345
+
+ +

As the local cache is indexed by URL, this causes every request to be unique, thereby bypassing the cache.

+ +

You can automatically adjust URLs using the following code:

+ +
var oReq = new XMLHttpRequest();
+
+oReq.open("GET", url + ((/\?/).test(url) ? "&" : "?") + (new Date()).getTime());
+oReq.send(null);
+ +

Biztonság

+ +

{{fx_minversion_note(3, "Versions of Firefox prior to Firefox 3 allowed you to set the preference capability.policy.<policyname>.XMLHttpRequest.open</policyname> to allAccess to give specific sites cross-site access. This is no longer supported.")}}

+ +

{{fx_minversion_note(5, "Versions of Firefox prior to Firefox 5 could use netscape.security.PrivilegeManager.enablePrivilege(\"UniversalBrowserRead\"); to request cross-site access. This is no longer supported, even though it produces no warning and permission dialog is still presented.")}}

+ +

The recommended way to enable cross-site scripting is to use the Access-Control-Allow-Origin HTTP header in the response to the XMLHttpRequest.

+ +

XMLHttpRequests being stopped

+ +

If you conclude with an XMLHttpRequest receiving status=0 and statusText=null, this means the request was not allowed to be performed. It was UNSENT. A likely cause for this is when the XMLHttpRequest origin (at the creation of the XMLHttpRequest) has changed when the XMLHttpRequest is subsequently open(). This case can happen, for example, when one has an XMLHttpRequest that gets fired on an onunload event for a window, the expected XMLHttpRequest is created when the window to be closed is still there, and finally sending the request (in otherwords, open()) when this window has lost its focus and another window gains focus. The most effective way to avoid this problem is to set a listener on the new window's {{event("activate")}} event which is set once the terminated window has its {{event("unload")}} event triggered.

+ +

Dolgozók

+ +

Setting overrideMimeType does not work from a {{domxref("Worker")}}.  See {{bug(678057)}} for more details.  Other browsers may handle this differently.

+ +

Specifikációk

+ + + + + + + + + + + + + + + + +
SpecifikációÁllapotMegjegyzés
{{SpecName('XMLHttpRequest')}}{{Spec2('XMLHttpRequest')}}Élő szabvány, legfrisebb verzió
+ +

Böngésző támogatás

+ + + +

{{Compat("api.XMLHttpRequest")}}

+ +

Kapcsolódó írások

+ +
    +
  1. MDN AJAX introduction
  2. +
  3. HTML in XMLHttpRequest
  4. +
  5. HTTP access control
  6. +
  7. How to check the security state of an XMLHTTPRequest over SSL
  8. +
  9. XMLHttpRequest - REST and the Rich User Experience
  10. +
  11. Microsoft documentation
  12. +
  13. "Using the XMLHttpRequest Object" (jibbering.com)
  14. +
  15. The XMLHttpRequest object: WHATWG specification
  16. +
diff --git a/files/hu/web/css/tools/border-radius_bemutato/index.html b/files/hu/web/css/tools/border-radius_bemutato/index.html new file mode 100644 index 0000000000..fe31d33429 --- /dev/null +++ b/files/hu/web/css/tools/border-radius_bemutato/index.html @@ -0,0 +1,1602 @@ +--- +title: Border-radius bemutató +slug: Web/CSS/Tools/Border-radius_bemutato +tags: + - CSS + - Eszközök +translation_of: Web/CSS/CSS_Background_and_Borders/Border-radius_generator +--- +

Ez az eszköz CSS3 {{cssxref("border-radius")}} beállítások megjelenítésére használható.

+ +
+

border-radius

+ +

HTML Content

+ +
<div id="container">
+    <div class="group section">
+        <div id="preview" class="col span_12">
+            <div id="subject">
+                <div id="top-left" class="radius-container"
+                    data-X="left" data-Y="top">
+                </div>
+                <div id="top-right" class="radius-container"
+                    data-X="right" data-Y="top">
+                </div>
+                <div id="bottom-right" class="radius-container"
+                    data-X="right" data-Y="bottom">
+                </div>
+                <div id="bottom-left" class="radius-container"
+                    data-X="left" data-Y="bottom">
+                </div>
+
+                <div id="radius-ui-sliders">
+                    <div id="tlr" class="ui-input-slider" data-topic="top-left"
+                         data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="tlw" class="ui-input-slider" data-topic="top-left-w"
+                         data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="tlh" class="ui-input-slider" data-topic="top-left-h"
+                        data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="trr" class="ui-input-slider" data-topic="top-right"
+                         data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="trw" class="ui-input-slider" data-topic="top-right-w"
+                         data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="trh" class="ui-input-slider" data-topic="top-right-h"
+                        data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="brr" class="ui-input-slider" data-topic="bottom-right"
+                         data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="brw" class="ui-input-slider" data-topic="bottom-right-w"
+                         data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="brh" class="ui-input-slider" data-topic="bottom-right-h"
+                        data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="blr" class="ui-input-slider" data-topic="bottom-left"
+                         data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="blw" class="ui-input-slider" data-topic="bottom-left-w"
+                         data-unit=" px" data-sensivity="2"></div>
+
+                    <div id="blh" class="ui-input-slider" data-topic="bottom-left-h"
+                        data-unit=" px" data-sensivity="2"></div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <div id="controls" class="group section">
+
+        <div class="group section">
+            <div id="dimensions">
+                <div class="ui-input-slider" data-topic="width" data-info="width"
+                     data-unit=" px" data-min="150" data-max="700" data-sensivity="1"></div>
+
+                <div class="ui-input-slider" data-topic="height" data-info="height"
+                    data-unit=" px" data-min="75" data-max="350" data-sensivity="1"></div>
+            </div>
+
+            <div id="output"></div>
+        </div>
+
+        <div class="group section">
+            <div id="radius-lock">
+                <div class="info"> lekerekített sarok </div>
+                <div class="ui-checkbox" data-topic='top-left'></div>
+                <div class="ui-checkbox" data-topic='top-right'></div>
+                <div class="ui-checkbox" data-topic='bottom-right'></div>
+                <div class="ui-checkbox" data-topic='bottom-left'></div>
+            </div>
+
+            <div id="unit-selection">
+                <div class="info"> szegély mértékegységei </div>
+            </div>
+        </div>
+
+    </div>
+</div>
+
+ +

CSS Content

+ +
/*  GRID OF TEN
+ * ========================================================================== */
+
+.span_12 {
+	width: 100%;
+}
+
+.span_11 {
+	width: 91.46%;
+}
+
+.span_10 {
+	width: 83%;
+}
+
+.span_9 {
+	width: 74.54%;
+}
+
+.span_8 {
+	width: 66.08%;
+}
+
+.span_7 {
+	width: 57.62%;
+}
+
+.span_6 {
+	width: 49.16%;
+}
+
+.span_5 {
+	width: 40.7%;
+}
+
+.span_4 {
+	width: 32.24%;
+}
+
+.span_3 {
+	width: 23.78%;
+}
+
+.span_2 {
+	width: 15.32%;
+}
+
+.span_1 {
+	width: 6.86%;
+}
+
+
+
+
+/*  SECTIONS
+ * ========================================================================== */
+
+.section {
+	clear: both;
+	padding: 0px;
+	margin: 0px;
+}
+
+/*  GROUPING
+ * ========================================================================== */
+
+
+.group:before, .group:after {
+    content: "";
+    display: table;
+}
+
+.group:after {
+    clear:both;
+}
+
+.group {
+    zoom: 1; /* For IE 6/7 (trigger hasLayout) */
+}
+
+/*  GRID COLUMN SETUP
+ * ========================================================================== */
+
+.col {
+	display: block;
+	float:left;
+	margin: 1% 0 1% 1.6%;
+}
+
+.col:first-child {
+	margin-left: 0;
+} /* all browsers except IE6 and lower */
+
+
+/*
+ * UI Component
+ */
+
+.ui-input-slider-container {
+	height: 20px;
+	margin: 10px 0;
+	font-family: "Segoe UI", Arial, Helvetica, sans-serif;
+	-moz-user-select: none;
+	user-select: none;
+}
+
+.ui-input-slider-container * {
+	float: left;
+	height: 100%;
+	line-height: 100%;
+}
+
+/* Input Slider */
+
+.ui-input-slider > input {
+	margin: 0;
+	padding: 0;
+	width: 50px;
+	text-align: center;
+
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+}
+
+.ui-input-slider-info {
+	width: 90px;
+	padding: 0px 10px 0px 0px;
+	text-align: right;
+	text-transform: lowercase;
+}
+
+.ui-input-slider-left, .ui-input-slider-right {
+	width: 16px;
+	cursor: pointer;
+	background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat;
+}
+
+.ui-input-slider-right {
+	background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat;
+}
+
+.ui-input-slider-name {
+	width: 90px;
+	padding: 0 10px 0 0;
+	text-align: right;
+	text-transform: lowercase;
+}
+
+.ui-input-slider-btn-set {
+	width: 25px;
+	background-color: #2C9FC9;
+	border-radius: 5px;
+	color: #FFF;
+	font-weight: bold;
+	line-height: 14px;
+	text-align: center;
+}
+
+.ui-input-slider-btn-set:hover {
+	background-color: #379B4A;
+	cursor: pointer;
+}
+
+/*
+ * UI Component
+ */
+
+/* Checkbox */
+
+.ui-checkbox {
+	text-align: center;
+	font-size: 16px;
+	font-family: "Segoe UI", Arial, Helvetica, sans-serif;
+	line-height: 1.5em;
+	color: #FFF;
+
+	-moz-user-select: none;
+	-webkit-user-select: none;
+	-ms-user-select: none;
+	user-select: none;
+}
+
+.ui-checkbox > input {
+ 	display: none;
+}
+
+.ui-checkbox > label {
+	font-size: 12px;
+	padding: 0.333em 1.666em 0.5em;
+	height: 1em;
+	line-height: 1em;
+
+	background-color: #888;
+	background-image: url("https://mdn.mozillademos.org/files/5683/disabled.png");
+	background-position: center center;
+	background-repeat: no-repeat;
+
+	color: #FFF;
+	border-radius: 3px;
+	font-weight: bold;
+	float: left;
+}
+
+.ui-checkbox .text {
+	padding-left: 34px;
+	background-position: center left 10px;
+}
+
+.ui-checkbox .left {
+	padding-right: 34px;
+	padding-left: 1.666em;
+	background-position: center right 10px;
+}
+
+.ui-checkbox > label:hover {
+	cursor: pointer;
+}
+
+.ui-checkbox > input:checked + label {
+	background-image: url("https://mdn.mozillademos.org/files/5681/checked.png");
+	background-color: #379B4A;
+}
+
+body {
+	max-width: 1000px;
+	margin: 0 auto;
+
+	font-family: "Segoe UI", Arial, Helvetica, sans-serif;
+
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+
+	-moz-user-select: none;
+	-webkit-user-select: none;
+	-ms-user-select: none;
+	user-select: none;
+}
+
+#container {
+	width: 100%;
+
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+}
+
+/******************************************************************************/
+/******************************************************************************/
+/*
+ * Preview Area
+ */
+
+#preview {
+	height: 500px;
+	border: 1px solid #CCC;
+	border-radius: 3px;
+	text-align: center;
+	overflow: hidden;
+	position: relative;
+}
+
+#preview .content {
+	width: 100%;
+	height: 100%;
+	display: block;
+}
+
+#preview input {
+	color: #333;
+	border: 1px solid #CCC;
+	border-radius: 3px;
+}
+
+#subject {
+	width: 400px;
+	height: 150px;
+	margin: 0 auto;
+	border: 3px solid #C60;
+	background: #FFF;
+	position: relative;
+}
+
+.radius {
+	width: 50%;
+	height: 50%;
+	border: 1px solid #CCC;
+	display: none;
+	position: absolute;
+	z-index: 1;
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+}
+
+.handle {
+	width: 16px;
+	height: 16px;
+	position: absolute;
+	z-index: 2;
+}
+
+.handle-top-left {
+	top: -12px;
+	left: -12px;
+	cursor: se-resize;
+	background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") top left no-repeat;
+}
+
+.handle-top-right {
+	top: -12px;
+	right: -12px;
+	cursor: sw-resize;
+	background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") top right no-repeat;
+}
+
+.handle-bottom-right {
+	bottom: -12px;
+	right: -12px;
+	cursor: nw-resize;
+	background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") bottom right no-repeat;
+}
+
+.handle-bottom-left {
+	bottom: -12px;
+	left: -12px;
+	cursor: ne-resize;
+	background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") bottom left no-repeat;
+}
+
+
+.radius-container {
+	position: absolute;
+	display : block;
+	z-index: 1;
+
+	-moz-box-sizing: border-box;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+}
+
+
+/* TOP LEFT */
+#top-left {
+	top: 0;
+	left: 0;
+}
+
+#top-left .radius {
+	border-top-left-radius: 100%;
+	top: 0;
+	left: 0;
+}
+
+/* TOP RIGHT */
+#top-right {
+	top: 0;
+	right: 0;
+}
+
+#top-right .radius {
+	border-top-right-radius: 100%;
+	top: 0;
+	right: 0;
+}
+
+/* BOTTOM RIGHT */
+#bottom-right {
+	bottom: 0;
+	right: 0;
+}
+
+#bottom-right .radius {
+	border-bottom-right-radius: 100%;
+	bottom: 0;
+	right: 0;
+}
+
+/* BOTTOM lEFT */
+#bottom-left {
+	bottom: 0;
+	left: 0;
+}
+
+#bottom-left .radius {
+	border-bottom-left-radius: 100%;
+	bottom: 0;
+}
+
+/* INPUT SLIDERS */
+
+#preview .ui-input-slider {
+	margin: 10px;
+	position: absolute;
+	z-index: 10;
+}
+
+#radius-ui-sliders {
+	width: 100%;
+	height: 100%;
+	min-height: 75px;
+	min-width: 150px;
+	padding: 20px 50px;
+	top: -20px;
+	left: -50px;
+	position: relative;
+}
+
+#tlr {
+	top: -30px;
+	left: -50px;
+	display: none;
+}
+
+#tlw {
+	top: -30px;
+	left: 30px;
+}
+
+#tlh {
+	top: 20px;
+	left: -50px;
+}
+
+#trr {
+	top: -30px;
+	right: -50px;
+	display: none;
+}
+
+#trw {
+	top: -30px;
+	right: 30px;
+}
+
+#trh {
+	top: 20px;
+	right: -50px;
+}
+
+#brr {
+	bottom: -30px;
+	right: -50px;
+	display: none;
+}
+
+#brw {
+	bottom: -30px;
+	right: 30px;
+}
+
+#brh {
+	bottom: 20px;
+	right: -50px;
+}
+
+#blr {
+	bottom: -30px;
+	left: -50px;
+	display: none;
+}
+
+#blw {
+	bottom: -30px;
+	left: 30px;
+}
+
+#blh {
+	bottom: 20px;
+	left: -50px;
+}
+
+#preview .ui-input-slider-left, #preview .ui-input-slider-right {
+	visibility: hidden;
+}
+
+#preview .ui-input-slider-container:hover .ui-input-slider-left {
+	visibility: visible;
+}
+
+#preview .ui-input-slider-container:hover .ui-input-slider-right {
+	visibility: visible;
+}
+
+/*
+ *
+ */
+
+#unit-selection {
+	width: 200px;
+	height: 75px;
+	margin: 30px 30px 0 0;
+	padding: 30px;
+	border: 3px solid #555;
+	border-radius: 10px;
+	position: relative;
+	float: right;
+}
+
+#unit-selection .info {
+	height: 20%;
+	width: 100%;
+	line-height: 20%;
+	font-size: 20px;
+	text-align: center;
+	position: relative;
+	top: 40%;
+}
+
+#unit-selection .dropdown {
+	width: 50px;
+	height: 20px;
+	margin: 10px;
+	padding: 0;
+	border-radius: 3px;
+	position: absolute;
+	overflow: hidden;
+}
+
+#unit-selection select {
+	width: 50px;
+	height: 20px;
+	marign: 0;
+	padding: 0 0 0 10px;
+	background: #555;
+	border: 1px solid #555;
+	border: none;
+	color: #FFF;
+	float: left;
+}
+
+#unit-selection select option {
+	background: #FFF;
+	color: #333;
+}
+
+#unit-selection select:hover {
+	cursor: pointer;
+}
+
+#unit-selection .dropdown:before {
+	content: "";
+	width: 18px;
+	height: 20px;
+	display: block;
+	background-color: #555;
+	background-image: url("https://mdn.mozillademos.org/files/5675/dropdown.png");
+	background-position: center center;
+	background-repeat: no-repeat;
+	top: 0px;
+	right: 0px;
+	position: absolute;
+	z-index: 1;
+	pointer-events: none;
+}
+
+#unit-selection .unit-top-left {
+	top: 0;
+	left: 0;
+	display: none;
+}
+
+#unit-selection .unit-top-left-w {
+	top: -22px;
+	left: 30px;
+}
+
+#unit-selection .unit-top-left-h {
+	top: 20px;
+	left: -37px;
+}
+
+#unit-selection .unit-top-right {
+	top: 0;
+	right: 0;
+	display: none;
+}
+
+#unit-selection .unit-top-right-w {
+	top: -22px;
+	right: 30px;
+}
+
+#unit-selection .unit-top-right-h {
+	top: 20px;
+	right: -37px;
+}
+
+#unit-selection .unit-bottom-right {
+	bottom: 0;
+	right: 0;
+	display: none;
+}
+
+#unit-selection .unit-bottom-right-w {
+	bottom: -22px;
+	right: 30px;
+}
+
+#unit-selection .unit-bottom-right-h {
+	bottom: 20px;
+	right: -37px;
+}
+
+#unit-selection .unit-bottom-left {
+	bottom: 0;
+	left: 0;
+	display: none;
+}
+
+#unit-selection .unit-bottom-left-w {
+	bottom: -22px;
+	left: 30px;
+}
+
+#unit-selection .unit-bottom-left-h {
+	bottom: 20px;
+	left: -37px;
+}
+
+/******************************************************************************/
+/******************************************************************************/
+
+
+#radius-lock {
+	width: 200px;
+	height: 75px;
+	margin: 30px 0 0 30px;
+	padding: 30px;
+	border: 3px solid #555;
+	border-radius: 10px;
+	position: relative;
+	float: left;
+}
+
+#radius-lock .ui-checkbox {
+	color: #FFF;
+	position: absolute;
+}
+
+#radius-lock .ui-checkbox > label {
+	height: 20px;
+	width: 34px;
+	padding: 0;
+}
+
+#radius-lock .info {
+	height: 20%;
+	width: 100%;
+	line-height: 20%;
+	font-size: 20px;
+	text-align: center;
+	position: relative;
+	top: 40%;
+}
+
+#radius-lock [data-topic="top-left"] {
+	top: 10px;
+	left: 10px;
+}
+
+#radius-lock [data-topic="top-right"] {
+	top: 10px;
+	right: 10px;
+}
+
+#radius-lock [data-topic="bottom-right"] {
+	bottom: 10px;
+	right: 10px;
+}
+
+#radius-lock [data-topic="bottom-left"] {
+	bottom: 10px;
+	left: 10px;
+}
+
+/**
+ * Controls
+ */
+
+#dimensions {
+	width: 200px;
+	color: #444;
+	float:left;
+}
+
+#dimensions input {
+	background: #555;
+	color: #FFF;
+	border: none;
+	border-radius: 3px;
+}
+
+#output {
+	width: 500px;
+	padding: 10px 0;
+	margin: 10px 0;
+	color: #555;
+	text-align: center;
+	border: 1px dashed #999;
+	border-radius: 3px;
+	-moz-user-select: text;
+	-webkit-user-select: text;
+	-ms-user-select: text;
+	user-select: text;
+
+	float: right;
+}
+
+
+
+ +

JavaScript Content

+ +
'use strict';
+
+
+/**
+ * UI-InputSliderManager
+ */
+
+var InputSliderManager = (function InputSliderManager() {
+
+	var subscribers = {};
+	var sliders = [];
+
+	var InputComponent = function InputComponent(obj) {
+		var input = document.createElement('input');
+		input.setAttribute('type', 'text');
+
+		input.addEventListener('click', function(e) {
+			this.select();
+		});
+
+		input.addEventListener('change', function(e) {
+			var value = parseInt(e.target.value);
+
+			if (isNaN(value) === true)
+				setValue(obj.topic, obj.value);
+			else
+				setValue(obj.topic, value);
+		});
+
+		subscribe(obj.topic, function(value) {
+			input.value = value + obj.unit;
+		});
+
+		return input;
+	}
+
+	var SliderComponent = function SliderComponent(obj, sign) {
+		var slider = document.createElement('div');
+		var startX = null;
+		var start_value = 0;
+
+		slider.addEventListener("click", function(e) {
+			setValue(obj.topic, obj.value + obj.step * sign);
+		});
+
+		slider.addEventListener("mousedown", function(e) {
+			startX = e.clientX;
+			start_value = obj.value;
+			document.body.style.cursor = "e-resize";
+			document.addEventListener("mousemove", sliderMotion);
+		});
+
+		document.addEventListener("mouseup", function(e) {
+			document.removeEventListener("mousemove", sliderMotion);
+			document.body.style.cursor = "auto";
+			slider.style.cursor = "pointer";
+		});
+
+		var sliderMotion = function sliderMotion(e) {
+			slider.style.cursor = "e-resize";
+			var delta = (e.clientX - startX) / obj.sensivity | 0;
+			var value = delta * obj.step + start_value;
+			setValue(obj.topic, value);
+		}
+
+		return slider;
+	}
+
+	var InputSlider = function(node) {
+		var min		= node.getAttribute('data-min') | 0;
+		var max		= node.getAttribute('data-max') | 0;
+		var step	= node.getAttribute('data-step') | 0;
+		var value	= node.getAttribute('data-value') | 0;
+		var topic	= node.getAttribute('data-topic');
+		var unit	= node.getAttribute('data-unit');
+		var name 	= node.getAttribute('data-info');
+		var sensivity = node.getAttribute('data-sensivity') | 0;
+
+		this.min = min;
+		this.max = max > 0 ? max : 100;
+		this.step = step === 0 ? 1 : step;
+		this.topic = topic;
+		this.node = node;
+		this.unit = unit;
+		this.sensivity = sensivity > 0 ? sensivity : 5;
+
+		var input = new InputComponent(this);
+		var slider_left  = new SliderComponent(this, -1);
+		var slider_right = new SliderComponent(this,  1);
+
+		slider_left.className = 'ui-input-slider-left';
+		slider_right.className = 'ui-input-slider-right';
+
+		if (name) {
+			var info = document.createElement('span');
+			info.className = 'ui-input-slider-info';
+			info.textContent = name;
+			node.appendChild(info);
+		}
+
+		node.appendChild(slider_left);
+		node.appendChild(input);
+		node.appendChild(slider_right);
+		node.className = 'ui-input-slider ui-input-slider-container';
+
+		this.input = input;
+		sliders[topic] = this;
+		setValue(topic, value);
+	}
+
+	var setValue = function setValue(topic, value, send_notify) {
+		var slider = sliders[topic];
+		if (slider === undefined)
+			return;
+
+		if (value > slider.max) value = slider.max;
+		if (value < slider.min)	value = slider.min;
+
+		slider.value = value;
+		slider.node.setAttribute('data-value', value);
+
+		if (send_notify !== undefined && send_notify === false) {
+			slider.input.value = value + slider.unit;
+			return;
+		}
+
+		notify.call(slider);
+	}
+
+	var setMax = function setMax(topic, value) {
+		var slider = sliders[topic];
+		if (slider === undefined)
+			return;
+
+		slider.max = value;
+		setValue(topic, slider.value);
+	}
+
+	var setMin = function setMin(topic, value) {
+		var slider = sliders[topic];
+		if (slider === undefined)
+			return;
+
+		slider.min = value;
+		setValue(topic, slider.value);
+	}
+
+	var setUnit = function setUnit(topic, unit) {
+		var slider = sliders[topic];
+		if (slider === undefined)
+			return;
+
+		slider.unit = unit;
+		setValue(topic, slider.value);
+	}
+
+	var getNode =  function getNode(topic) {
+		return sliders[topic].node;
+	}
+
+	var subscribe = function subscribe(topic, callback) {
+		if (subscribers[topic] === undefined)
+			subscribers[topic] = [];
+		subscribers[topic].push(callback);
+	}
+
+	var unsubscribe = function unsubscribe(topic, callback) {
+		subscribers[topic].indexOf(callback);
+		subscribers[topic].splice(index, 1);
+	}
+
+	var notify = function notify() {
+		for (var i in subscribers[this.topic]) {
+			subscribers[this.topic][i](this.value);
+		}
+	}
+
+	var init = function init() {
+		var elem = document.querySelectorAll('.ui-input-slider');
+		var size = elem.length;
+		for (var i = 0; i < size; i++)
+			new InputSlider(elem[i]);
+	}
+
+	return {
+		init : init,
+		setMax : setMax,
+		setMin : setMin,
+		setUnit : setUnit,
+		getNode : getNode,
+		setValue : setValue,
+		subscribe : subscribe,
+		unsubscribe : unsubscribe
+	}
+
+})();
+
+/**
+ * UI-ButtonManager
+ */
+
+var ButtonManager = (function CheckBoxManager() {
+
+	var subscribers = [];
+	var buttons = [];
+
+	var CheckBox = function CheckBox(node) {
+		var topic = node.getAttribute('data-topic');
+		var state = node.getAttribute('data-state');
+		var name = node.getAttribute('data-label');
+		var align = node.getAttribute('data-text-on');
+
+		state = (state === "true");
+
+		var checkbox = document.createElement("input");
+		var label = document.createElement("label");
+
+		var id = 'checkbox-' + topic;
+		checkbox.id = id;
+		checkbox.setAttribute('type', 'checkbox');
+		checkbox.checked = state;
+
+		label.setAttribute('for', id);
+		if (name) {
+			label.className = 'text';
+			if (align)
+				label.className += ' ' + align;
+			label.textContent = name;
+		}
+
+		node.appendChild(checkbox);
+		node.appendChild(label);
+
+		this.node = node;
+		this.topic = topic;
+		this.checkbox = checkbox;
+
+		checkbox.addEventListener('change', function(e) {
+			notify.call(this);
+		}.bind(this));
+
+		buttons[topic] = this;
+	}
+
+	var getNode =  function getNode(topic) {
+		return buttons[topic].node;
+	}
+
+	var setValue = function setValue(topic, value) {
+		try {
+			buttons[topic].checkbox.checked = value;
+		}
+		catch(error) {
+			console.log(error);
+		}
+	}
+
+	var subscribe = function subscribe(topic, callback) {
+		if (subscribers[topic] === undefined)
+			subscribers[topic] = [];
+
+		subscribers[topic].push(callback);
+	}
+
+	var unsubscribe = function unsubscribe(topic, callback) {
+		subscribers[topic].indexOf(callback);
+		subscribers[topic].splice(index, 1);
+	}
+
+	var notify = function notify() {
+		for (var i = 0; i < subscribers[this.topic].length; i++)
+			subscribers[this.topic][i](this.checkbox.checked);
+	}
+
+	var init = function init() {
+		var elem = document.querySelectorAll('.ui-checkbox');
+		var size = elem.length;
+		for (var i = 0; i < size; i++)
+			new CheckBox(elem[i]);
+	}
+
+	return {
+		init : init,
+		setValue : setValue,
+		subscribe : subscribe,
+		unsubscribe : unsubscribe
+	}
+
+})();
+
+
+window.addEventListener("load", function() {
+	BorderRadius.init();
+});
+
+var BorderRadius = (function BorderRadius() {
+
+	function getElemById(id) {
+		return document.getElementById(id);
+	}
+
+	/**
+	 * Shadow dragging
+	 */
+	var PreviewMouseTracking = (function Drag() {
+		var active = false;
+		var lastX = 0;
+		var lastY = 0;
+		var subscribers = [];
+
+		var init = function init(id) {
+			var elem = getElemById(id);
+			elem.addEventListener('mousedown', dragStart, false);
+			document.addEventListener('mouseup', dragEnd, false);
+		}
+
+		var dragStart = function dragStart(e) {
+			if (e.button !== 0)
+				return;
+
+			active = true;
+			lastX = e.clientX;
+			lastY = e.clientY;
+			document.addEventListener('mousemove', mouseDrag, false);
+		}
+
+		var dragEnd = function dragEnd(e) {
+			if (e.button !== 0)
+				return;
+
+			if (active === true) {
+				active = false;
+				document.removeEventListener('mousemove', mouseDrag, false);
+			}
+		}
+
+		var mouseDrag = function mouseDrag(e) {
+			notify(e.clientX - lastX, e.clientY - lastY);
+			lastX = e.clientX;
+			lastY = e.clientY;
+		}
+
+		var subscribe = function subscribe(callback) {
+			subscribers.push(callback);
+		}
+
+		var unsubscribe = function unsubscribe(callback) {
+			var index = subscribers.indexOf(callback);
+			subscribers.splice(index, 1);
+		}
+
+		var notify = function notify(deltaX, deltaY) {
+			for (var i in subscribers)
+				subscribers[i](deltaX, deltaY);
+		}
+
+		return {
+			init : init,
+			subscribe : subscribe,
+			unsubscribe : unsubscribe
+		}
+
+	})();
+
+	var subject;
+	var units = ['px', '%'];
+	var output = null;
+
+	var UnitSelector = function UnitSelector(topic) {
+
+		this.container = document.createElement("div");
+		this.select = document.createElement("select");
+		for (var i in units) {
+			var option = document.createElement("option");
+			option.value = i;
+			option.textContent = units[i];
+			this.select.appendChild(option);
+		}
+
+		this.container.className = 'dropdown ' + 'unit-' + topic;
+		this.container.appendChild(this.select);
+	}
+
+	UnitSelector.prototype.setValue = function setValue(value) {
+		this.salect.value = value;
+	}
+
+
+	var RadiusContainer = function RadiusContainer(node) {
+		var radius = document.createElement('div');
+		var handle = document.createElement('div');
+		var x = node.getAttribute('data-x');
+		var y = node.getAttribute('data-y');
+		var active = false;
+
+		this.id = node.id;
+		this.node = node;
+		this.radius = radius;
+		this.handle = handle;
+		this.width = 100;
+		this.height = 50;
+		this.size = 0;
+		this.rounded = false;
+
+		this.unitX = 0;
+		this.unitY = 0;
+		this.unitR = 0;
+
+		this.maxW = 100;
+		this.maxH = 100;
+		this.maxR = 100;
+
+		this.topic = y + '-' + x;
+
+		var sliderW = InputSliderManager.getNode(this.topic + '-w');
+		var sliderH = InputSliderManager.getNode(this.topic + '-h');
+		var sliderR = InputSliderManager.getNode(this.topic);
+
+		this.setUnitX(this.unitX);
+		this.setUnitY(this.unitY);
+		this.setUnitR(this.unitR);
+
+		this.updateWidth();
+		this.updateHeight();
+		this.updateRadius();
+
+		if (x === 'left')	this.resizeX =  1;
+		if (x === 'right')	this.resizeX = -1;
+		if (y === 'top')	this.resizeY =  1;
+		if (y === 'bottom')	this.resizeY = -1;
+
+		radius.className = 'radius';
+
+		var unit_selector = document.getElementById("unit-selection");
+		var unitW = new UnitSelector(this.topic + '-w');
+		var unitH = new UnitSelector(this.topic + '-h');
+		var unitR = new UnitSelector(this.topic);
+
+		unit_selector.appendChild(unitW.container);
+		unit_selector.appendChild(unitH.container);
+		unit_selector.appendChild(unitR.container);
+		node.appendChild(radius);
+		subject.appendChild(handle);
+
+		unitW.select.addEventListener('change', function(e) {
+			this.setUnitX(e.target.value | 0);
+		}.bind(this));
+
+		unitH.select.addEventListener('change', function(e) {
+			this.setUnitY(e.target.value | 0);
+		}.bind(this));
+
+		unitR.select.addEventListener('change', function(e) {
+			this.setUnitR(e.target.value | 0);
+		}.bind(this));
+
+		if (x === 'left' && y == 'top') handle.className = 'handle handle-top-left'
+		if (x === 'right' && y == 'top') handle.className = 'handle handle-top-right';
+		if (x === 'right' && y == 'bottom') handle.className = 'handle handle-bottom-right';
+		if (x === 'left' && y == 'bottom') 	handle.className = 'handle handle-bottom-left';
+
+		handle.addEventListener("mousedown", function(e) {
+			active = true;
+			this.radius.style.display = 'block';
+			PreviewMouseTracking.subscribe(this.updateContainer.bind(this));
+		}.bind(this));
+
+		document.addEventListener("mouseup", function(e) {
+			this.radius.style.display = 'none';
+			if (active === true)
+				PreviewMouseTracking.unsubscribe(this.updateContainer.bind(this));
+		}.bind(this));
+
+		InputSliderManager.subscribe(this.topic + '-w', this.setWidth.bind(this));
+		InputSliderManager.subscribe(this.topic + '-h', this.setHeight.bind(this));
+		InputSliderManager.subscribe(this.topic, this.setRadius.bind(this));
+
+		ButtonManager.subscribe(this.topic, function(value) {
+			this.rounded = value;
+			if (value === true) {
+				unitW.container.style.display = 'none';
+				unitH.container.style.display = 'none';
+				unitR.container.style.display = 'block';
+				sliderW.style.display = 'none';
+				sliderH.style.display = 'none';
+				sliderR.style.display = 'block';
+				this.setUnitR(this.unitR);
+				this.updateRadius();
+			}
+
+			if (value === false) {
+				unitW.container.style.display = 'block';
+				unitH.container.style.display = 'block';
+				unitR.container.style.display = 'none';
+				sliderW.style.display = 'block';
+				sliderH.style.display = 'block';
+				sliderR.style.display = 'none';
+				this.setUnitX(this.unitX);
+				this.setUnitY(this.unitY);
+				this.updateWidth();
+				this.updateHeight();
+			}
+
+			this.updateBorderRadius();
+
+		}.bind(this));
+
+		this.updateBorderRadius();
+	}
+
+	RadiusContainer.prototype.updateWidth = function updateWidth() {
+		this.node.style.width = this.width + units[this.unitX];
+		var value = Math.round(this.width / 2);
+		InputSliderManager.setValue(this.topic + '-w', value, false);
+	}
+
+	RadiusContainer.prototype.updateHeight = function updateHeight() {
+		this.node.style.height = this.height + units[this.unitY];
+		var value = Math.round(this.height / 2);
+		InputSliderManager.setValue(this.topic + '-h', value, false);
+	}
+
+	RadiusContainer.prototype.updateRadius = function updateRadius() {
+		var value = Math.round(this.size / 2);
+		this.node.style.width = this.size + units[this.unitR];
+		this.node.style.height = this.size + units[this.unitR];
+		InputSliderManager.setValue(this.topic, value, false);
+	}
+
+	RadiusContainer.prototype.setWidth = function setWidth(value) {
+		this.radius.style.display = 'block';
+		this.width = 2 * value;
+		this.node.style.width = this.width + units[this.unitX];
+		this.updateBorderRadius();
+	}
+
+	RadiusContainer.prototype.setHeight = function setHeight(value) {
+		this.radius.style.display = 'block';
+		this.height = 2 * value;
+		this.node.style.height = this.height + units[this.unitY];
+		this.updateBorderRadius();
+	}
+
+	RadiusContainer.prototype.setRadius = function setRadius(value) {
+		this.radius.style.display = 'block';
+		this.size = 2 * value;
+		this.node.style.width = this.size + units[this.unitR];
+		this.node.style.height = this.size + units[this.unitR];
+		this.updateBorderRadius();
+	}
+
+	RadiusContainer.prototype.setUnitX = function setUnitX(value) {
+		this.unitX = value;
+		if (this.unitX === 0) this.maxW = 2 * subject.clientWidth;
+		if (this.unitX === 1) this.maxW = 200;
+		InputSliderManager.setUnit(this.topic + '-w', units[this.unitX]);
+		InputSliderManager.setMax(this.topic + '-w', this.maxW / 2);
+	}
+
+	RadiusContainer.prototype.setUnitY = function setUnitY(value) {
+		this.unitY = value;
+		if (this.unitY === 0) this.maxH = 2 * subject.clientHeight;
+		if (this.unitY === 1) this.maxH = 200;
+		InputSliderManager.setUnit(this.topic + '-h', units[this.unitY]);
+		InputSliderManager.setMax(this.topic + '-h', this.maxH / 2);
+	}
+
+	RadiusContainer.prototype.setUnitR = function setUnitR(value) {
+		this.unitR = value;
+
+		if (this.unitR === 0)
+			this.maxR = 2 * Math.min(subject.clientHeight , subject.clientWidth);
+
+		if (this.unitR === 1)
+			this.maxR = 200;
+
+		InputSliderManager.setUnit(this.topic, units[this.unitR]);
+		InputSliderManager.setMax(this.topic, this.maxR / 2);
+	}
+
+	RadiusContainer.prototype.updateUnits = function updateUnits(unit) {
+		if (this.rounded) {
+			this.setUnitR(this.unitR);
+			return;
+		}
+
+		if (unit === 0)
+			this.setUnitX(this.unitX);
+
+		if (unit === 1)
+			this.setUnitY(this.unitY);
+	}
+
+	RadiusContainer.prototype.composeBorderRadius = function composeBorderRadius () {
+
+		if (this.rounded === true) {
+			var unit = units[this.unitR];
+			var value = Math.round(this.size / 2);
+			return value + unit;
+		}
+
+		var unitX = units[this.unitX];
+		var unitY = units[this.unitY];
+		var valueX = Math.round(this.width / 2);
+		var valueY = Math.round(this.height / 2);
+
+		if (valueX === valueY && this.unitX === this.unitY)
+			return valueX + unitX;
+
+		return valueX + unitX + ' ' + valueY + unitY;
+	}
+
+	RadiusContainer.prototype.updateBorderRadius = function updateBorderRadius () {
+		var radius = this.composeBorderRadius();
+		var corner = 0;
+
+		if (this.topic === 'top-left') {
+			subject.style.borderTopLeftRadius = radius;
+			corner = 0;
+		}
+
+		if (this.topic === 'top-right') {
+			subject.style.borderTopRightRadius = radius;
+			corner = 1;
+		}
+
+		if (this.topic === 'bottom-right') {
+			subject.style.borderBottomRightRadius = radius;
+			corner = 2;
+		}
+
+		if (this.topic === 'bottom-left') {
+			subject.style.borderBottomLeftRadius = radius;
+			corner = 3;
+		}
+
+		Tool.updateOutput(corner, radius);
+	}
+
+	RadiusContainer.prototype.updateContainer = function updateContainer(deltaX, deltaY) {
+
+		if (this.rounded === true) {
+			this.size += this.resizeX * deltaX + this.resizeY * deltaY;
+			if (this.size < 0)	this.size = 0;
+			if (this.size > this.maxR)	this.size = this.maxR;
+			this.updateRadius();
+			this.updateBorderRadius();
+			return;
+		}
+
+		if (deltaX) {
+			this.width += this.resizeX * deltaX;
+			if (this.width < 0)	this.width = 0;
+			if (this.width > this.maxW)	this.width = this.maxW;
+			this.updateWidth();
+		}
+
+		if (deltaY) {
+			this.height += this.resizeY * deltaY;
+			if (this.height < 0) this.height = 0;
+			if (this.height > this.maxH)	this.height = this.maxH;
+			this.updateHeight();
+		}
+
+		if (deltaX || deltaY)
+			this.updateBorderRadius();
+	}
+
+
+	/**
+	 * Tool Manager
+	 */
+	var Tool = (function Tool() {
+		var preview;
+		var preview_ui;
+		var radius_containers = [];
+		var border_width = 3;
+		var borders1 = [null, null, null, null];
+		var borders2 = [0, 0, 0, 0];
+
+		var updateUIWidth = function updateUIWidth(value) {
+			var pwidth = subject.parentElement.clientWidth;
+			var left = (pwidth - value) / 2;
+			subject.style.width = value + "px";
+
+			for (var i = 0; i < 4; i++)
+				radius_containers[i].updateUnits(0);
+		}
+
+		var updateUIHeight = function updateUIHeight(value) {
+			var pheight = subject.parentElement.clientHeight;
+			var top = (pheight - value) / 2;
+			subject.style.height = value + "px";
+			subject.style.top = top - border_width + "px";
+
+			for (var i = 0; i < 4; i++)
+				radius_containers[i].updateUnits(1);
+		}
+
+		var updatePreviewUIWidth = function updatePreviewUIWidth() {
+			var p = subject.parentElement.clientWidth;
+			var v = preview_ui.clientWidth;
+			console.log(p, v, (p - v ) / 2);
+			preview_ui.style.left = (p - v) / 2 + "px" ;
+		}
+
+		var updatePreviewUIHeight = function updatePreviewUIHeight() {
+			var p = subject.parentElement.clientHeight;
+			var v = preview_ui.clientHeight;
+			console.log(p, v, (p - v ) / 2);
+			preview_ui.style.top = (p - v) / 2 + "px" ;
+		}
+
+		var updateOutput = function updateOutput(corner, radius) {
+			var values = radius.split(" ");
+
+			borders1[corner] = values[0];
+			borders2[corner] = values[0];
+
+			if (values.length === 2)
+				borders2[corner] = values[1];
+
+			var border_1_value = borders1.join(" ");
+			var border_2_value = borders2.join(" ");
+			var border_radius = 'border-radius: ' + border_1_value;
+
+			if (border_2_value !== border_1_value)
+				border_radius += ' / ' + border_2_value;
+
+			border_radius += ';';
+			output.textContent = border_radius;
+		}
+
+		var init = function init() {
+			preview = getElemById("preview");
+			subject = getElemById("subject");
+			output = getElemById("output");
+			preview_ui = getElemById("radius-ui-sliders");
+
+			var elem = document.querySelectorAll('.radius-container');
+			var size = elem.length;
+			for (var i = 0; i < size; i++)
+				radius_containers[i] = new RadiusContainer(elem[i]);
+
+			InputSliderManager.subscribe("width", updateUIWidth);
+			InputSliderManager.subscribe("height", updateUIHeight);
+
+			InputSliderManager.setValue("width", subject.clientWidth);
+			InputSliderManager.setValue("height", subject.clientHeight);
+		}
+
+		return {
+			init : init,
+			updateOutput : updateOutput
+		}
+
+	})();
+
+	/**
+	 * Init Tool
+	 */
+	var init = function init() {
+		ButtonManager.init();
+		InputSliderManager.init();
+		PreviewMouseTracking.init("preview");
+		Tool.init();
+	}
+
+	return {
+		init : init
+	}
+
+})();
+
+
+
+
+ +

{{ EmbedLiveSample('border-radius-generator', '100%', '800px', '') }}

+ +

 

diff --git a/files/hu/web/css/tools/index.html b/files/hu/web/css/tools/index.html new file mode 100644 index 0000000000..12b96335ce --- /dev/null +++ b/files/hu/web/css/tools/index.html @@ -0,0 +1,18 @@ +--- +title: Tools +slug: Web/CSS/Tools +tags: + - CSS + - NeedsContent + - NeedsTranslation + - TopicStub +translation_of: Web/CSS/Tools +--- +
+ {{Draft}}
+

CSS offers a number of powerful features that can be tricky to use, or have a number of parameters that it's helpful to be able to visualize while you work. This page offers links to a number of useful tools that will help you build the CSS to style your content using these features.

+

{{LandingPageListSubpages}}

+

See also

+ diff --git a/files/hu/web/guide/api/index.html b/files/hu/web/guide/api/index.html new file mode 100644 index 0000000000..950affd971 --- /dev/null +++ b/files/hu/web/guide/api/index.html @@ -0,0 +1,25 @@ +--- +title: Guide to Web APIs +slug: Web/Guide/API +tags: + - API + - Guide + - Landing + - NeedsTranslation + - TopicStub + - Web +translation_of: Web/Guide/API +--- +

Here you'll find links to each of the guides introducing and explaining each of the APIs that make up the Web development architecture.

+

Web APIs from A to Z

+ +

{{ListGroups}}

+ +

See also

+ + diff --git a/files/hu/web/guide/grafika/index.html b/files/hu/web/guide/grafika/index.html new file mode 100644 index 0000000000..c9c2880069 --- /dev/null +++ b/files/hu/web/guide/grafika/index.html @@ -0,0 +1,48 @@ +--- +title: Grafikák az interneten +slug: Web/Guide/Grafika +tags: + - 2D + - 3D + - Canvas + - Grafika + - HTML5 + - SVG + - WebGL + - WebRTC +translation_of: Web/Guide/Graphics +--- +

Gyakran használunk különféle grafikákat a weboldalakon, illetve alkalmazásokban. Statikus képek megjelenítésére egyszerűen használható az {{HTMLElement("img")}} elem, vagy az adott képet beállíthatjuk egy HTML elem hátterének is a {{cssxref("background-image")}} tulajdonság segítségével. Ugyanakkor JavaScript használatával bármikor készíthető új kép, vagy manipulálható egy meglévő. Az alábbi útmutatók segítséget nyújtanak a különféle grafikák használatában.

+ +
+
+

2D Grafika

+ +
+
Canvas
+
A {{HTMLElement("canvas")}} elemre API-n keresztül 2D-s grafikák rajzolhatók JavaScript használatával.
+
SVG
+
A Scalable Vector Graphics (SVG) vonalak, görbék és más geometriai alakzatok használatával rajzolja ki a kívánt képet. A vektorok használatával olyan képek készíthetők, amelyek bármilyen méretre nagyíthatóak minőségvesztés és torzulás nélkül.
+
+ +

Összes megtekintése...

+
+ +
+

3D Grafika

+ +
+
WebGL
+
Útmutató a WebGL használatához, a webes 3D grafikus API-hoz. Ez a technológia lehetővé teszi a szabványos OpenGL ES használatát a webes tartalomban.
+
+ +

Videó

+ +
+
HTML5 audió és videó használata
+
Videó és / vagy hang beágyazása egy weboldalra és a lejátszás vezérlése.
+
WebRTC
+
A WebRTC elnevezésben az RTC a "Real-Time Communications" rövidítése. Ez a technológia teszi lehetővé az audio / video streamelést, valamint az adatok megosztását a böngészőkliensek (peerek) között.
+
+
+
diff --git a/files/hu/web/guide/index.html b/files/hu/web/guide/index.html new file mode 100644 index 0000000000..415bd14d23 --- /dev/null +++ b/files/hu/web/guide/index.html @@ -0,0 +1,27 @@ +--- +title: Web developer guide +slug: Web/Guide +tags: + - Guide + - Landing + - NeedsTranslation + - TopicStub + - Web +translation_of: Web/Guide +--- +

These articles provide how-to information to help you make use of specific technologies and APIs.

+
+

Note: This page is going to be a mess for a little while until we finish migrating content. Our apologies!

+
+
+ {{LandingPageListSubpages}}
+
+
+ JavaScript
+
+ JavaScript is the powerful scripting language used to create applications for the Web.
+
+

See also

+ diff --git a/files/hu/web/html/element/article/index.html b/files/hu/web/html/element/article/index.html new file mode 100644 index 0000000000..025121f8e8 --- /dev/null +++ b/files/hu/web/html/element/article/index.html @@ -0,0 +1,133 @@ +--- +title: '
: The Article Contents element' +slug: Web/HTML/Element/article +translation_of: Web/HTML/Element/article +--- +

{{HTMLRef}}

+ +

A HTML <article> elem önálló egység egy dokumentumon, egy lapon, egy alkalmazáson, vagy egy oldalon belül, melynek célja a tartalom független megoszthatósága vagy újrafelhasználhatósága (lásd például a hírügynökségeknél). Ilyen például egy fórum bejegyzés, magazin - vagy újságcikk, illetve blogbejegyzés.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tartalmi kategóriákFolytatólagos (flow) tartalom, szakaszoló tartalom, megfogható tartalom.
Megengedett tartalomFolytatólagos (flow) tartalom.
Tag kihagyás{{no_tag_omission}}
Megengedett szülőkBármilyen elem, ami megengedi a folytatólagos tartalmat. Megjegyzendő, hogy egy <article> elem nem lehet egy {{HTMLElement("address")}} elem leszármazottja.
Megengedett ARIA szerepek{{ARIARole("application")}}, {{ARIARole("document")}}, {{ARIARole("feed")}}, {{ARIARole("main")}}, {{ARIARole("presentation")}}, {{ARIARole("region")}}
DOM interfész{{domxref("HTMLElement")}}
+ +

Attribútumok

+ +

Ez az elem csak a globális attribútumokat tartalmazza.

+ +

Megjegyzések a használathoz

+ + + +

Examples

+ +
<article class="film_review">
+  <header>
+    <h2>Jurassic Park</h2>
+  </header>
+  <section class="main_review">
+    <p>A dínók klasszak!</p>
+  </section>
+  <section class="user_reviews">
+    <article class="user_review">
+      <p>Túl félelmetes nekem.</p>
+      <footer>
+        <p>
+          Ekkor:
+          <time datetime="2015-05-16 19:00">Május 16</time>
+          Lisa írta.
+        </p>
+      </footer>
+    </article>
+    <article class="user_review">
+      <p>Egyetértek, a dínók a kedvenceim.</p>
+      <footer>
+        <p>
+          Ekkor:
+          <time datetime="2015-05-17 19:00">Május 17</time>
+          Tom írta.
+        </p>
+      </footer>
+    </article>
+  </section>
+  <footer>
+    <p>
+      Ekkor
+      <time datetime="2015-05-15 19:00">Május 15</time>
+      Staff írta.
+    </p>
+  </footer>
+</article>
+
+ +

Specifikációk

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecifikációÁllapotMegjegyzés
{{SpecName('HTML WHATWG', 'semantics.html#the-article-element', '<article>')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5.1', 'sections.html#the-article-element', '<article>')}}{{Spec2('HTML5.1')}} 
{{SpecName('HTML5 W3C', 'sections.html#the-article-element', '<article>')}}{{Spec2('HTML5 W3C')}} 
+ +

Böngésző kompatibilitás

+ + + +

{{Compat("html.elements.article")}}

+ +

Lásd még

+ + diff --git a/files/hu/web/html/element/br/index.html b/files/hu/web/html/element/br/index.html new file mode 100644 index 0000000000..fe45867643 --- /dev/null +++ b/files/hu/web/html/element/br/index.html @@ -0,0 +1,136 @@ +--- +title:
+slug: Web/HTML/Element/br +translation_of: Web/HTML/Element/br +--- +

Összefoglalás

+ +

A HTML <br> elem (vagy HTML sortörés elem) egy sortörést hoz létre a szövegben (kocsi-vissza). Hasznos versek és olyan címek írásakor, ahol a sorok felosztása fontos.

+ +

Ne használja a <br> elemet a szöveg sorai között lévő térköz növelésére. Használja a CSS {{cssxref('margin')}} tulajdonságot vagy a {{HTMLElement("p")}} elemet.

+ + + +

Attribútumok

+ +

Ez az elem a globális attribútumokkal rendelkezik.

+ +
+
{{htmlattrdef("clear")}} {{deprecatedGeneric('inline','HTML4.01')}} {{obsoleteGeneric('inline','HTML5')}}
+
Azt jelzi, hogy hol kezdődjön a következő sor a törés után. +
+

Használati megjegyzés: Ez az attribútum elavult a {{HTMLVersionInline(5)}} óta és a szerzők nem használhatják. Használja helyette a CSS {{CSSxref('clear')}} tulajdonságot.

+
+
+
+ +

Példa

+ +
Mozilla Foundation<br>
+1981 Landings Drive<br>
+Building K<br>
+Mountain View, CA 94043-0801<br>
+USA
+
+ +

A fenti HTML kimenete:

+ +

Mozilla Foundation
+ 1981 Landings Drive
+ Building K
+ Mountain View, CA 94043-0801
+ USA

+ +

Specifikációk

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecifikációÁllapotMegjegyzés
{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-br-element', '<br>')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'the-br-element.html#the-b-element', '<br>')}}{{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'struct/text.html#h-9.3.2.1', '<br>')}}{{Spec2('HTML4.01')}}
+ +

Böngésző kompatibilitás

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
SzolgáltatásChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Alap támogatás1.0{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
SzolgáltatásAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Alap támogatás{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Lásd még

+ + + +
{{HTMLRef}}
diff --git a/files/hu/web/html/element/index.html b/files/hu/web/html/element/index.html new file mode 100644 index 0000000000..7711b85207 --- /dev/null +++ b/files/hu/web/html/element/index.html @@ -0,0 +1,213 @@ +--- +title: HTML elements reference +slug: Web/HTML/Element +tags: + - HTML + - 'HTML:Element Reference' + - NeedsTranslation + - TopicStub +translation_of: Web/HTML/Element +--- +

This HTML reference lists all HTML elements, defined in HTML5 or in a previous specification. When enclosed within angle brackets, they form HTML tags: <elementname>. Elements are entities specifying how HTML documents should be built, and what kind of content should be placed in what part of an HTML document.

+

This page lists all standard HTML5 tags, but also older, obsolete and deprecated ones, as well as non-standard ones that browsers may support. Elements that were introduced in HTML5 are often referred as the new HTML5 elements, even though the other standard elements also are valid in HTML5.

+

In an HTML document, an element is defined by a starting tag. If the element contains other content, it ends with a closing tag, where the element name is preceded by a forward slash: </elementname>. Some elements don't need to be closed, such as image elements. These are known as void elements. HTML documents contain a tree of these elements. Each is named to represent what it does. For example, the <title> element represents the title of the document. Below is an alphabetical list of the HTML Elements.

+
+ A +
    +
  • {{ HTMLElement("a") }}
  • +
  • {{ HTMLElement("abbr") }}
  • +
  • {{ HTMLElement("acronym") }}
  • +
  • {{ HTMLElement("address") }}
  • +
  • {{ HTMLElement("applet") }}
  • +
  • {{ HTMLElement("area") }}
  • +
  • {{ HTMLElement("article") }}
  • +
  • {{ HTMLElement("aside") }}
  • +
  • {{ HTMLElement("audio") }}
  • +
+ B +
    +
  • {{ HTMLElement("b") }}
  • +
  • {{ HTMLElement("base") }}
  • +
  • {{ HTMLElement("basefont") }}
  • +
  • {{ HTMLElement("bdi") }}
  • +
  • {{ HTMLElement("bdo") }}
  • +
  • {{ HTMLElement("bgsound") }}
  • +
  • {{ HTMLElement("big") }}
  • +
  • {{ HTMLElement("blink") }}
  • +
  • {{ HTMLElement("blockquote") }}
  • +
  • {{ HTMLElement("body") }}
  • +
  • {{ HTMLElement("br") }}
  • +
  • {{ HTMLElement("button") }}
  • +
+ C +
    +
  • {{ HTMLElement("canvas") }}
  • +
  • {{ HTMLElement("caption") }}
  • +
  • {{ HTMLElement("center") }}
  • +
  • {{ HTMLElement("cite") }}
  • +
  • {{ HTMLElement("code") }}
  • +
  • {{ HTMLElement("col") }}
  • +
  • {{ HTMLElement("colgroup") }}
  • +
  • {{ HTMLElement("command") }}
  • +
+ D +
    +
  • {{ HTMLElement("data") }}
  • +
  • {{ HTMLElement("datalist") }}
  • +
  • {{ HTMLElement("dd") }}
  • +
  • {{ HTMLElement("del") }}
  • +
  • {{ HTMLElement("details") }}
  • +
  • {{ HTMLElement("dfn") }}
  • +
  • {{ HTMLElement("dir") }}
  • +
  • {{ HTMLElement("div") }}
  • +
  • {{ HTMLElement("dl") }}
  • +
  • {{ HTMLElement("dt") }}
  • +
+ E +
    +
  • {{ HTMLElement("em") }}
  • +
  • {{ HTMLElement("embed") }}
  • +
+ F +
    +
  • {{ HTMLElement("fieldset") }}
  • +
  • {{ HTMLElement("figcaption") }}
  • +
  • {{ HTMLElement("figure") }}
  • +
  • {{ HTMLElement("font") }}
  • +
  • {{ HTMLElement("footer") }}
  • +
  • {{ HTMLElement("form") }}
  • +
  • {{ HTMLElement("frame") }}
  • +
  • {{ HTMLElement("frameset") }}
  • +
+ G H +
    +
  • {{ HTMLElement("h1") }}
  • +
  • {{ HTMLElement("h2") }}
  • +
  • {{ HTMLElement("h3") }}
  • +
  • {{ HTMLElement("h4") }}
  • +
  • {{ HTMLElement("h5") }}
  • +
  • {{ HTMLElement("h6") }}
  • +
  • {{ HTMLElement("head") }}
  • +
  • {{ HTMLElement("header") }}
  • +
  • {{ HTMLElement("hgroup") }}
  • +
  • {{ HTMLElement("hr") }}
  • +
  • {{ HTMLElement("html") }}
  • +
+ I +
    +
  • {{ HTMLElement("i") }}
  • +
  • {{ HTMLElement("iframe") }}
  • +
  • {{ HTMLElement("img") }}
  • +
  • {{ HTMLElement("input") }}
  • +
  • {{ HTMLElement("ins") }}
  • +
  • {{ HTMLElement("isindex") }}
  • +
+ J K +
    +
  • {{ HTMLElement("kbd") }}
  • +
  • {{ HTMLElement("keygen") }}
  • +
+ L +
    +
  • {{ HTMLElement("label") }}
  • +
  • {{ HTMLElement("legend") }}
  • +
  • {{ HTMLElement("li") }}
  • +
  • {{ HTMLElement("link") }}
  • +
  • {{ HTMLElement("listing") }}
  • +
+ M +
    +
  • {{HTMLElement("main")}}
  • +
  • {{ HTMLElement("map") }}
  • +
  • {{ HTMLElement("mark") }}
  • +
  • {{ HTMLElement("marquee") }}
  • +
  • {{ HTMLElement("menu") }}
  • +
  • {{ HTMLElement("meta") }}
  • +
  • {{ HTMLElement("meter") }}
  • +
+ N +
    +
  • {{ HTMLElement("nav") }}
  • +
  • {{ HTMLElement("nobr") }}
  • +
  • {{ HTMLElement("noframes") }}
  • +
  • {{ HTMLElement("noscript") }}
  • +
+ O +
    +
  • {{ HTMLElement("object") }}
  • +
  • {{ HTMLElement("ol") }}
  • +
  • {{ HTMLElement("optgroup") }}
  • +
  • {{ HTMLElement("option") }}
  • +
  • {{ HTMLElement("output") }}
  • +
+ P +
    +
  • {{ HTMLElement("p") }}
  • +
  • {{ HTMLElement("param") }}
  • +
  • {{ HTMLElement("plaintext") }}
  • +
  • {{ HTMLElement("pre") }}
  • +
  • {{ HTMLElement("progress") }}
  • +
+ Q +
    +
  • {{ HTMLElement("q") }}
  • +
+ R +
    +
  • {{ HTMLElement("rp") }}
  • +
  • {{ HTMLElement("rt") }}
  • +
  • {{ HTMLElement("ruby") }}
  • +
+ S +
    +
  • {{ HTMLElement("s") }}
  • +
  • {{ HTMLElement("samp") }}
  • +
  • {{ HTMLElement("script") }}
  • +
  • {{ HTMLElement("section") }}
  • +
  • {{ HTMLElement("select") }}
  • +
  • {{ HTMLElement("small") }}
  • +
  • {{ HTMLElement("source") }}
  • +
  • {{ HTMLElement("spacer") }}
  • +
  • {{ HTMLElement("span") }}
  • +
  • {{ HTMLElement("strike") }}
  • +
  • {{ HTMLElement("strong") }}
  • +
  • {{ HTMLElement("style") }}
  • +
  • {{ HTMLElement("sub") }}
  • +
  • {{ HTMLElement("summary") }}
  • +
  • {{ HTMLElement("sup") }}
  • +
+ T +
    +
  • {{ HTMLElement("table") }}
  • +
  • {{ HTMLElement("tbody") }}
  • +
  • {{ HTMLElement("td") }}
  • +
  • {{ HTMLElement("textarea") }}
  • +
  • {{ HTMLElement("tfoot") }}
  • +
  • {{ HTMLElement("th") }}
  • +
  • {{ HTMLElement("thead") }}
  • +
  • {{ HTMLElement("time") }}
  • +
  • {{ HTMLElement("title") }}
  • +
  • {{ HTMLElement("tr") }}
  • +
  • {{ HTMLElement("track") }}
  • +
  • {{ HTMLElement("tt") }}
  • +
+ U +
    +
  • {{ HTMLElement("u") }}
  • +
  • {{ HTMLElement("ul") }}
  • +
+ V +
    +
  • {{ HTMLElement("var") }}
  • +
  • {{ HTMLElement("video") }}
  • +
+ W +
    +
  • {{ HTMLElement("wbr") }}
  • +
+ X Y Z +
    +
  • {{ HTMLElement("xmp") }}
  • +
+
+

The symbol This element has been added in HTML5 indicates that the element has been added in HTML5. Note that other elements listed here may have been modified or extended by the HTML5 specification. Dimmed elements are non-standard, obsolete, or deprecated; they must not be used in new Web sites, and should gradually be removed from existing ones to avoid unwanted results.

diff --git a/files/hu/web/html/element/section/index.html b/files/hu/web/html/element/section/index.html new file mode 100644 index 0000000000..61b3ac6922 --- /dev/null +++ b/files/hu/web/html/element/section/index.html @@ -0,0 +1,128 @@ +--- +title: '
: The Generic Section element' +slug: Web/HTML/Element/section +translation_of: Web/HTML/Element/section +--- +
{{HTMLRef}}
+ +

A HTML <section> elem egy olyan önálló rész egy HTML dokumentumon belül, amelynek nem létezik egy azt jobban leíró szemantikai eleme. Egy szekciónak általában van egy fejléce is.

+ +

Egy navigációs menüt egy {{htmlelement("nav")}} elembe kellene ágyazni, míg például keresési eredmények egy listáját vagy egy térképet és annak vezérlőit egy <section> elembe, mivel ezeknek nincsenek külön meghatározott, összefoglaló elemei.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tartalmi kategóriákFolytatólagos tartalom, Szakaszoló tartalom, megfogható tartalom.
Megengedett tartalomFolytatólagos tartalom.
Tag kihagyás{{no_tag_omission}}
Megengedett szülőkBármilyen elem, ami megengedi a folytatólagos tartalmat. Megjegyzendő, hogy egy {{HTMLElement("section")}} elem nem lehet egy {{HTMLElement("address")}} elem leszármazottja.
Megengedett ARIA szerepek{{ARIARole("alert")}}, {{ARIARole("alertdialog")}}, {{ARIARole("application")}}, {{ARIARole("banner")}}, {{ARIARole("complementary")}}, {{ARIARole("contentinfo")}}, {{ARIARole("dialog")}}, {{ARIARole("document")}}, {{ARIARole("feed")}}, {{ARIARole("log")}}, {{ARIARole("main")}}, {{ARIARole("marquee")}}, {{ARIARole("navigation")}}, {{ARIARole("search")}}, {{ARIARole("status")}}, {{ARIARole("tabpanel")}}
DOM interfész{{domxref("HTMLElement")}}
+ +

Attribútumok

+ +

Ez az elem csak a globális attribútumokat tartalmazza.

+ +

Megjegyzések a használathoz

+ +
    +
  • Minden <section> elemet illene azonosítani egy belőle származtatott cím (heading) elemmel ({{HTMLElement('h1')}}-{{HTMLElement('h6')}} elemek).
  • +
  • Ha érdemes egy {{HTMLElement("section")}} elem tartalmát elkülönülten tárolni, illetve megosztani, akkor a {{HTMLElement("article")}} elemet használd helyette.
  • +
  • Ne használd a {{HTMLElement("section")}} elemet általános tárolóként, hiszen arra való a {{HTMLElement("div")}}. Különösen igaz ez akkor, ha a részekre osztásnak csak a külalaknál van szerepe. A gyakorlati szabály az, hogy egy <section> elem logikailag kellene, hogy tagolja a dokumentumot.
  • +
+ +

1. példa

+ +

Előtte

+ +
<div>
+  <h1>Cím</h1>
+  <p>Egy rakás klassz dolog</p>
+</div>
+ +

Utána

+ +
<section>
+  <h1>Cím</h1>
+  <p>Egy rakás klassz dolog</p>
+</section>
+
+ +

2. példa

+ +

Előtte

+ +
<div>
+  <h2>Cím</h2>
+  <img src="bird.jpg" alt="madár">
+</div>
+
+ +

Utána

+ +
<section>
+  <h2>Cím</h2>
+  <img src="bird.jpg" alt="madár">
+</section>
+
+ +

Specifikációk

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecifikációÁllapotTartalom
{{SpecName('HTML WHATWG', 'sections.html#the-section-element', '<section>')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5.1', 'sections.html#the-section-element', '<section>')}}{{Spec2('HTML5.1')}} 
{{SpecName('HTML5 W3C', 'sections.html#the-section-element', '<section>')}}{{Spec2('HTML5 W3C')}} 
+ +

Böngésző kompatibilitás

+ + + +

{{Compat("html.elements.section")}}

+ +

Lásd még

+ +
    +
  • Egyéb, a szakaszokra osztáshoz kapcsolódó elemek : {{HTMLElement("body")}}, {{HTMLElement("nav")}}, {{HTMLElement("article")}}, {{HTMLElement("aside")}}, {{HTMLElement("h1")}}, {{HTMLElement("h2")}}, {{HTMLElement("h3")}}, {{HTMLElement("h4")}}, {{HTMLElement("h5")}}, {{HTMLElement("h6")}}, {{HTMLElement("hgroup")}}, {{HTMLElement("header")}}, {{HTMLElement("footer")}}, {{HTMLElement("address")}};
  • +
  • Egy HTML5 dokumentum szakaszai és külleme
  • +
diff --git a/files/hu/web/html/index.html b/files/hu/web/html/index.html new file mode 100644 index 0000000000..b2313a0aa3 --- /dev/null +++ b/files/hu/web/html/index.html @@ -0,0 +1,84 @@ +--- +title: HTML +slug: Web/HTML +tags: + - HTML + - HTML5 + - Markup + - Referenciák +translation_of: Web/HTML +--- +
+
HTML5 DemÓK
+ +

Egy demó kollekció, amely megmutatja a legfrissebb HTML technológiákat működés közben.

+ +

The logo of HTML

+
+ +

HyperText Markup Language (HTML) a weboldalak és más böngészőben megjelenő dokumentumok elkészítéséhez használt nyelv. Pontosabban, a HTML az a nyelv, amely a dokumentum struktúráját és a szemantikus tartalmát jellemzi. A tartalom olyan HTML elemekkel van megjelölve, mint például: {{HTMLElement("head")}}, {{HTMLElement("title")}}, {{HTMLElement("body")}}, {{HTMLElement("header")}}, {{HTMLElement("footer")}}, {{HTMLElement("article")}}, {{HTMLElement("section")}}, {{HTMLElement("p")}}, {{HTMLElement("div")}}, {{HTMLElement("span")}}, {{HTMLElement("img")}}, {{HTMLElement("aside")}}, {{HTMLElement("audio")}}, {{HTMLElement("canvas")}}, {{HTMLElement("datalist")}}, {{HTMLElement("details")}}, {{HTMLElement("embed")}}, {{HTMLElement("nav")}}, {{HTMLElement("output")}}, {{HTMLElement("progress")}}, {{HTMLElement("video")}}, és még sok más.

+ +

HTML egy nemzetközi szabvány, amelynek a leírása a World Wide Web Konzorcium és a WHATWG által karbantartott.

+ +

A HTML egy élő szabvány, amely technikailag folyamatos fejlesztés alatt áll. A jelenlegi HTML szabvány verziójára HTML5 ként hivatkozunk.

+ +
+
+

HTML Dokumentáció

+ +
+
Bevezetés a HTML-be
+
Ez az oldal alapvető információkat nyújt a HTML oldalak (dokumentumok) szintaktikájáról és szemantikájáról. Olyan alapvető tájékoztatást, amelyek a HTML dokumentumok fejlesztéséhez szükségesek.
+
HTML elemek referenciája
+
Részletes leírás a különböző böngészők által támogatott elemekről.
+
HTML attribútum lista
+
Tekintsd meg az összes attribútumot és azt, hogy ezek mely elemekhez tartoznak.
+
HTML5
+
Ismerd meg az új HTML5 API-kat, elemeket és velük együtt a támogatottságukat.
+
HTML Form útmutató
+
A HTML űrlapok komplex összetevőit képezik a HTML-nek. Ez az útmutató segítséget nyújt leküzdeni őket, a struktúrától a dizájnolásig, illetve a böngésző támogatástól az egyedi kontrolokig.
+
Helytelen copy-paste szokások
+
A web technológiák nagyon sűrűn a meglévő oldalak forrásainak kimásolásával kerülnek elsajátításra. Azonban, ez gyakran a rossz szokások fenttartásával jár. A következő oldal pár ilyen helytelen berögződést listáz ki és megmutatja, hogy hogyan lehet elérni helyesen az általuk képviselt célt.
+
Képek rajzolása Canvas segítségével
+
Egy új HTML elem a programozott grafikához. A <canvas>-t képek renderelésére, UI elemekre és számos más egyedi grafikára lehet felhasználni kliens oldalon.
+
Tippek gyors HTML oldalak authorizálásához
+
Egy optimalizált weboldal nem csak több reszponzivitást nyújt a látogatók számára, de a webszervereken és az internet kapcsolaton is csökkenti a terheket.
+
+ +

Összes megtekintése...

+
+ +
+

Segítségkérés a közösségtől

+ +

HTML-lel kapcsolatos segítségre van szükséged és nem találod a megoldást a dokumentációban?

+ +
    +
  • Egyeztess az erre a célra hivatott Mozilla fórumon
  • +
  • Látogass el a Stack Overflow-ra, az együttműködéssel kiépített és karbantartott Kérdések és Válaszok oldalra, és nézz utána, hogy megválaszolták-e már a kérdésed. Amennyiben még nem, úgy felteheted azt.
  • +
+ +

Ne feledkezz meg a netikettről...

+ +

Eszközök, amelyek megkönnyítik a HTML fejlesztést

+ + + +

Összes megtekintése...

+
+
+ +

Kapcsolódó témakörök

+ + diff --git a/files/hu/web/index.html b/files/hu/web/index.html new file mode 100644 index 0000000000..2bed7ddf10 --- /dev/null +++ b/files/hu/web/index.html @@ -0,0 +1,53 @@ +--- +title: Web technology for developers +slug: Web +tags: + - Landing + - NeedsTranslation + - TopicStub + - Web +translation_of: Web +--- +

The open Web presents incredible opportunities for developers. To take full advantage of these technologies, you need to know how to use them. Below you'll find links to our Web technology documentation.

+ +
+
+

Dokumentáció Webfejlesztők számára

+ +
+
Web Developer Reference
+
A list of all references for Web technologies, including those for HTML, CSS, and so on.
+
Web Developer Guide
+
The Web Developer Guide provides useful how-to content to help you actually use Web technologies to do what you want or need to do.
+
Tutorials for Web developers
+
A list of tutorials to take you step-by-step through learning APIs, technologies, or broad topic areas.
+
Developing Web applications
+
Documentation for Web application developers; Web apps are true write-once, deploy anywhere apps for mobile, desktop, and Firefox OS.
+
Code snippets
+
This is a quick list of useful code snippets (small code samples) available for developers of extensions for the various Mozilla applications. Many of these samples can also be used in XULRunner applications, as well as in actual Mozilla code itself.
+
+ +

View All...

+
+ +
+

Webtechnológiai hivatkozások

+ +
+
Web APIs
+
Reference material for each of the individual APIs that comprise the Web's powerful scriptability, including the DOM and all of the related APIs and interfaces you can use to build Web content and apps.
+
HTML
+
HyperText Markup Language is the language used to describe and define the content of a Web page.
+
CSS
+
Cascading Style Sheets are used to describe the appearance of Web content.
+
SVG
+
Scalable Vector Graphics let you describe images as sets of vectors and shapes in order to allow them to scale smoothly regardless of the size at which they're drawn.
+
MathML
+
The Mathematical Markup Language makes it possible to display complex mathematical equations and syntax.
+
WebGL
+
WebGL brings 3D graphics to the Web by introducing an API that closely conforms to OpenGL ES 2.0 that can be used in HTML {{HTMLElement("canvas")}} elements
+
+
+
+ +

 

diff --git a/files/hu/web/javascript/a_javascript_ujboli_bemutatasa/index.html b/files/hu/web/javascript/a_javascript_ujboli_bemutatasa/index.html new file mode 100644 index 0000000000..89192fcbf4 --- /dev/null +++ b/files/hu/web/javascript/a_javascript_ujboli_bemutatasa/index.html @@ -0,0 +1,948 @@ +--- +title: A JavaScript újbóli bemutatása +slug: Web/JavaScript/a_javascript_ujboli_bemutatasa +translation_of: Web/JavaScript/A_re-introduction_to_JavaScript +--- +
{{jsSidebar}}
+ +

Hogy miért újboli bemutatása? Azért, mert a {{Glossary("JavaScript")}} a világ legfélreértetteb programozási nyelveként ismert. Gyakran lebecsülik mint egyfajta játékszert, de az egyszerűsége mellett, erőteljes nyelvi eszközökkel rendelkezik. A JavaScript -et manapság rengeteg fontos alkalmazásban használják, ami azt mutatja, hogy ennek a technológiának a tudása minden web - és mobilalkalmazás fejlesztőnek egy fontos tulajdonsága.

+ +

Érdemes a nyelv történetének áttekintésével kezdeni. A JavaScript -et Brendan Eich tervezte 1995 -ben, aki a Netscape - nél volt mérnök. A JavaScript először a Netscape 2 -vel lett kiadva 1996 elején. A nyelvet eredetileg LiveScript - nek nevezték, de egy szerencsétlen marketingdöntés miatt átnevezték, amivel a Sun Microsystems nyelvének, a Java -nak a népszerűségét akarták a hasznukra fordítani, noha a két nyelvben kevés közös dolog volt. Ez máig az összezavarodottság egyik forrása.

+ +

Néhány hónappal később Microsoft bemutatta a JScript - et az Internet Explorer 3 kiadásakor. Ez egy nagymértékben JavaScript kompatibilis nyelv volt. Néhány hónap elteltével a Netscape átadta a JavaScript - et az Ecma International - nek, és ez az európai szabványosító szervezet még ebben az évben nyilvánosságra hozta az {{Glossary("ECMAScript")}} első verzióját . A szabvány 1999 - ben jelentős frissitést kapott a ECMAScript edition 3 -al, és azóta nagyon stabil. A szabvány negyedik kiadása a politikai nézeteltérések, és a nyelv növekvő komplexitása miatt megszűnt. A negyedik verzió sok eleme képezte alapját a szabvány ötödik, és hatodik kiadásának, amiket 2009. decemberében, valamint 2015 Júniusában adtak ki.

+ +
+

Az ismertség miatt innentől az ECMAScript helyett a JavaScript megnevezést használjuk.

+
+ +

A legtöbb programozásinyelvtől eltérően, a JavaScript - ben nincs terv a standard ki - és bemenetre. A JavaScript arra lett tervezve, hogy egy szkriptként fusson egy hoszt környezetben, így ezen környezet mechanizmusainak feladata a külvilággal való kapcsolat biztosítása. A leggyakrabban erre használt hoszt környezet a böngésző, ám sok más alkalmazásban is található értelmező, mint a Node.js, NoSQL adatbázisok mint a nyílt forrású Apache CouchDB, beágyazott rendszerek, teljes asztali környezetek mint a GNOME (A GNU/Linux operációs rendszerek számára az egyik a legnépszerűbb grafikus felhasználói interfészek közül),  és még sok más.

+ +

Áttekintés

+ +

A JavaScript multi-paradigmájú nyelv, típusokkal, operátorokkal, beépített standard objektumokkal, és metódusokkal. A szintaxisa a Java és a C nyelvekel alapul — sok struktúra lett ezekből a nyelvekből a JavaScript - be átvéve. A JavaScript osztályok helyett prototípus objektumokkal támogatja az objektumorintáltságot (többet erről prototypical inheritance és ES2015 classes). A JavaScript a funkcionális programozást is támogatja — a függvények objektumok, lehetővé teszik a végrehajtható kód tárolását, és a függvények, mint minden objektum, továbbadhatóak.

+ +

Kezdjük a nyelv éíptőköveinek szemlélésével. A JavaScript programok értékeket manipulálnak, és minden értéknek van egy meghatározott típusa. JavaScript típusok a:

+ +
    +
  • {{jsxref("Number")}}
  • +
  • {{jsxref("String")}}
  • +
  • {{jsxref("Boolean")}}
  • +
  • {{jsxref("Function")}}
  • +
  • {{jsxref("Object")}}
  • +
  • {{jsxref("Symbol")}} (new in ES2015)
  • +
+ +

... ó, és {{jsxref("undefined")}} és a {{jsxref("null")}}, amik egy kissé speciálisak, az  {{jsxref("Array")}}, ami egy különleges fajtájú objektum, a {{jsxref("Date")}} és a {{jsxref("RegExp")}}, amiket csak úgy kapsz. Ha pontosak akarunk lenni, a függvények is egy fajta objektumok. Tehát a típusok felsorolása inkább így néz ki:

+ +
    +
  • {{jsxref("Number")}}
  • +
  • {{jsxref("String")}}
  • +
  • {{jsxref("Boolean")}}
  • +
  • {{jsxref("Symbol")}} (Az ES2015 - ben új)
  • +
  • {{jsxref("Object")}} +
      +
    • {{jsxref("Function")}}
    • +
    • {{jsxref("Array")}}
    • +
    • {{jsxref("Date")}}
    • +
    • {{jsxref("RegExp")}}
    • +
    +
  • +
  • {{jsxref("null")}}
  • +
  • {{jsxref("undefined")}}
  • +
+ +

és van még néhány előre definiált {{jsxref("Error")}} típus. Az egyszerűség kedvéért most csak az első felsorolásra korlátozódunk.

+ +

Számok

+ +

A számok a JavaScript - ben a specifikáció szerint "dupla precíz 64-bit formátumú IEEE 754 értékek". Ennek van néhány érdekes következménye. JavaScript - ben nincs olyasmihez hasonlítható, mint az integer, ami miatt óvatosan kell az aritmetikával bánni, ha a matematikát úgy alkalmazzuk mint a C -ben, vagy Java -ban.

+ +

Figyelj oda olyan dolgokra, mint:

+ +
0.1 + 0.2 == 0.30000000000000004;
+
+ +

A gyakolatban az integer értékek 32-Bit -es integerként vannak kezelve, és egyes implemetációk még úgy is tárolják őket, amíg egy olyan utasítást kell végrehajtsanak ami egy számra, de nem egy integerre érvényes. Ez például a bitműveleteknél lehet fontos.

+ +

Támogatottak az alapértelmezett aritmetikai operátorok, beleértve az összeadást, kivonást, modulo (maradék), és így tovább. Ezenkívül létezik még egy {{jsxref("Math")}} objektum, ami olyan matematikai funkciókat nyújt, amik fent még nem lettek említve:

+ +
Math.sin(3.5);
+var atmero = 2 * Math.PI * r;
+
+ +

Egy stringet a beépített {{jsxref("Global_Objects/parseInt", "parseInt()")}} funkcióval integerré lehet konvertálni. A funkció megkapja a használt számrendszer alapját, ez a második opcionális paraméter, ami mindig meg kell legyen adva:

+ +
parseInt('123', 10); // 123
+parseInt('010', 10); // 10
+
+ +

Régebbi böngészőkön a 0 -val kezdődő sztringek oktális számként értelmeződnek (8 -as alapú), de ez 2013 óta már nincs így. Ha nem vagyunk biztosak a string formátumban, a régebbi böngészők meglepő ereményhez vezethetnek:

+ +
parseInt('010');  //  8
+parseInt('0x10'); // 16
+
+ +

Itt látható, hogy a {{jsxref("Global_Objects/parseInt", "parseInt()")}} függvény a 0 előtag miatt az első stringet oktális számként, a második stringet a "0x" előtag miatt hexadecimális számként értelmezi. A hexadecimális szemlélet még mindig megengedett, csak az oktális lett eltávolítva.

+ +

Ha egy bináris számot szeretnél integerré alakítani, egyszerűen a bázist kell megváltoztatni 2 -re.

+ +
parseInt('11', 2); // 3
+
+ +

Ezzel a módszerrel lebegőpontos számokat is konvertálhatunk a {{jsxref("Global_Objects/parseFloat", "parseFloat()")}} függvény segítségével. A {{jsxref("Global_Objects/parseInt", "parseInt()")}} függvénnyel ellentétben, a parseFloat() mindig 10 -es bázist használ.

+ +

Az unáris (egy operandusú) + operátor is használható számok konvertálására:

+ +
+ '42';   // 42
++ '010';  // 10
++ '0x10'; // 16
+
+ +

Ha egy string nem tartalmaz numerikus értékeet, egy speciális érték a {{jsxref("NaN")}} (A "Not a Number" rövidítése) adódik vissza.

+ +
parseInt('hello', 10); // NaN
+
+ +

A NaN veszélyes: Ha egy matematikai művelet egyik operandusaként használjuk, az eredmény is NaN lesz:

+ +
NaN + 5; // NaN
+
+ +

A beépített {{jsxref("Global_Objects/isNaN", "isNaN()")}} függvény segítségével lehet megállapítani, hogy egy változó értéke NaN - e:

+ +
isNaN(NaN); // true
+
+ +

A JavaScript - ben vannak olyan speciális értékek is, mint az {{jsxref("Infinity")}} és a -Infinity:

+ +
 1 / 0; //  Infinity
+-1 / 0; // -Infinity
+
+ +

Az Infinity, -Infinity és NaN értékeket a beépített {{jsxref("Global_Objects/isFinite", "isFinite()")}} függvényekel lehet tesztelni:

+ +
isFinite(1 / 0); // false
+isFinite(-Infinity); // false
+isFinite(NaN); // false
+
+ +
A {{jsxref("Global_Objects/parseInt", "parseInt()")}} és a {{jsxref("Global_Objects/parseFloat", "parseFloat()")}} addig olvassák a stringet, amíg nem találnak egy olyan karaktert, ami a számrendszerben nem található, és csak az eddig beolvasott számokat adja vissza értékül. Az unáris "+" viszont egyszerűen NaN értéket ad vissza, ha a string egy nem érvényes karaktert tartalmaz. Próbáld meg értelmezni a konzolban a "10.2abc" stringet, hogy jobban megérthesd a köztük lévő különbségeket.
+ +

Karakterláncok

+ +

A stringek a JavaScript -ben Unicode karakterek sorozata. Ez mindenki számára örvendetes lehet, akik több nyelvű szoftvereken dolgoznak. Még pontosabban fogalmazva, a stringek UTF-16 kódegységek sorozata; mindegy egyes egység egy 16-bites számmal van reprezentálva. Minden Unicode karakter egy, vagy két kódegységből áll.

+ +

Egyetlen karakter reprezentálásához egyszerűen egyetlen karaktert használunk.

+ +

Egy string hosszát (kód egységekben), a length property -vel (tulajdonság, az objektum tagváltozója) kapjuk meg:

+ +
'hello'.length; // 5
+
+ +

Ez az első találkozásunk egy JavaScript objektummal! Említettük már, hogy a stringeket úgy használhatjuk, mint az {{jsxref("Object", "objektumokat", "", 1)}} ? Vannak nekik {{jsxref("String", "metódusaik", "#Methods", 1)}} is, amiknek segítségével megváltoztathatjuk a stringet, és információkat kaphatunk róla:

+ +
'hello'.charAt(0); // "h"
+'hello, world'.replace('world', 'mars'); // "hello, mars"
+'hello'.toUpperCase(); // "HELLO"
+
+ +

Egyéb típusok

+ +

A JavaScript különbséget tesz a {{jsxref("null")}}, ami egy "nem értéket" reprezentál, (és csak a null kulcsszón keresztül érhető el), és az {{jsxref("undefined")}} között, ami egy undefined típus, és egy nem inicializált értéket jelez, tehát hogy még nem lett a változónak érték adva. A változókról még később szó lesz, de a JavaScript -ben lehet úgy változókat deklarálni, hogy nem rendelünk hozzá értéket. Ha így teszel, a változó típusa undefined lesz. Az undefined egy konstans.

+ +

A JavaScript -nek van egy boolean típusa, true és false lehetséges értékkekkel (mindkettő ezek közül kulcsszó.) Minden érték boolean - é konvertálható a következő szabályok figyelembevételével:

+ +
    +
  1. false, 0, üres stringek (""), NaN, null, és undefined értékekből false lesz.
  2. +
  3. Minden más értékből true lesz.
  4. +
+ +

A konverzió közvetlenül a Boolean() függvénnyel hajtható végre:

+ +
Boolean('');  // false
+Boolean(234); // true
+
+ +

Viszont ez alig szükséges, mivel a JavaScript automatikusan elvégzi a konverziót,ha boolean értéket vár, mint például az if utasítás esetén (lásd lentebb). Ezen ok miatt gyakran beszélünk "true értékekről" és "false értékekről," ami alatt azt értjük, hogy az értékek true vagy false lesznek, miután Boolean -é lettek átalakítva. Ezek az értékek másképpen "truthy" és "falsy".

+ +

A Boolean műveletek mint például az && (logikai és), || (logikai vagy), és ! (logikai nem) támogatottak (lásd lentebb).

+ +

Változók

+ +

JavaScript-ben az új változókat három kulcsszóval lehet deklarálni: let, const, vagy var.
+
+ A let kulcsszóval blokk szintű változókat lehet deklarálni. Az így deklarált változó abból a kód blokkból érhető el, ahol azt definiálták.

+ +
let a;
+let name = 'Simon';
+
+ +

A következő példa a let kulcsszóval deklarált változó láthatóságát mutatja be.

+ +
// A myLetVariable itt *NEM* látható.
+
+for (let myLetVariable = 0; myLetVariable < 5; myLetVariable++) {
+  // A myLetVariable csak itt elérhető
+}
+
+// A myLetVariable itt *NEM* látható.
+
+
+ +

A const kulcsszóval olyan változó deklarálható, aminek az értéke nem változik meg. A változó abból a kód blokkból érhető el, amiben deklarálták.

+ +
const Pi = 3.14; // A Pi változó értékének megadása
+Pi = 1; // kivételt fog dobni, mivel egy konstans értéke nem változtatható meg
+ +


+ A var a leghasználatosabb deklaratív kulcsszó, nincsenek olyan korlátozásai mint a másik kettőnek. Ennek az az oka, hogy hagyományosan ez volt az egyetlen mód egy változó deklarálására a JavaScriptben. A var kulcsszóval deklarált változó abban a függvényben érhető el, amiben azt deklarálták.

+ +
var a;
+var name = 'Simon';
+ +

A következő példa a var kulcsszóval deklarált változó láthatóságát mutatja be.

+ +
// A myVarVariable itt látható
+
+for (var myVarVariable = 0; myVarVariable < 5; myVarVariable++) {
+  // A myVarVariable látható az egész függvényben
+}
+
+// A myVarVariable itt is látható
+
+ +

Ha egy olyan változót deklarálunk, amihez nem lett érték hozzárendelve, a típusa undefined lesz.

+ +

Egy fontos különbség a JavaScript és más nyelvek között (pl. a Java),  hogy a JavaScript-ben a blokkoknak nincsen érvényességi területük (scope), Csak a függvényeknek. Szóval, ha egy var kulcsszóval definiálunk változót (például egy if vezérlőszerkezeten belül), Akkor az az egész függvényben látható lesz. Azonban az ECMAScript 2015-ös verziójától, a let és const kulcsszóval deklarált változók, lehetővé teszik a scope-ok létrehozását.

+ +

Operátorok

+ +

A JavaScript's numerikus operátorai a +, -, *, / és % ami a maradék operátor (Ami nem ugyanaz, mint a modulo.) Az értékadás az = használatával történik, és létezik összevont értékadás is mint a += és a -=. Ezek a következőféleképp értelmezendőek:
+ x = x operator y.

+ +
x += 5;
+x = x + 5;
+
+ +

A ++ és -- operátorokat inkrementálásta and dekrementálásra lehet használni. Ezek használhatóak prefix és postfix operátorokként is.

+ +

A + operátor stringek egyesítésére is :

+ +
'hello' + ' world'; // "hello world"
+
+ +

Ha egy stringet és egy számot (vagy más értéket) összeadunk, először minden string-é konvertálódik. Ez néha problémák forrása:

+ +
'3' + 4 + 5;  // "345"
+ 3 + 4 + '5'; // "75"
+
+ +

Egy üres string hozzáadása egy értékhez jó módszer arra, hogy az értéket string-é konvertáljuk.

+ +

A JavaScriptben Összehasonlításokat a <, >, <= és >= operátorok használatával lehet elvégezni. Ezek stringek és számok esetén használhatóak. Az egyenlőség egy kicsit bonyolultabb. Az == operátor típuskonverziót kényszerít ki, ami érdekes eredményekhez vezethet:

+ +
123 == '123'; // true
+1 == true; // true
+
+ +

A típuskonverzió elkerüléséhez használjuk a === (teljesen egyenlő) operátort:

+ +
123 === '123'; // false
+1 === true;    // false
+
+ +

Léteznek != és !== operátorok is.

+ +

A JavaScript-ben vannak bitszintű műveletek is.

+ +

Vezérlő szerkezetek

+ +

A JavaScript hasonló a C nyelvcsalád nyelveihez hasonlóvezérlő szerkezetekkel rendelkezik. Feltételes utasítások az if és else kulcsszavakkal hozhatók létre. Ezek összeláncolhatóak:

+ +
var name = 'kittens';
+if (name == 'puppies') {
+  name += ' woof';
+} else if (name == 'kittens') {
+  name += ' meow';
+} else {
+  name += '!';
+}
+name == 'kittens meow';
+
+ +

A JavaScript-ben vannak while és do-while ciklusok. Az egyszerű alkalmas egyszerű ciklusok létrehozására; a második olyan ciklusok létrehozására használatos, ahol biztosítani kívánjuk, hogy a ciklus tartalma (ciklusmag) legalább egyszer lefusson:

+ +
while (true) {
+  // végtelen ciklus!
+}
+
+var input;
+do {
+  input = get_input();
+} while (inputIsNotValid(input));
+
+ +

A JavaScript for ciklusa ugyanaz mint a C-ben és Java-ban megszokott: A vezérlőinformációk egyetlen sorban megadhatóak.

+ +
for (var i = 0; i < 5; i++) {
+  // ötször fut le
+}
+
+ +

A JavaScript-ben van két másik népszerű for ciklus is:
+ A for...of

+ +
for (let value of array) {
+  // value feldolgozása
+}
+
+ +

és a for...in:

+ +
for (let property in object) {
+  // objektum tulajdonságának feldolgozása
+}
+
+ +

A && és || operátorok a rövidzár logikát alkalmazzák, ami azt jelenti, hogy a második operandus végrehajtása az eslő operandustól függ. Ez hasznos null objektumok ellenőrzésére, mielőtt megpróbálnánk hozzáférni az attributúmaihoz:

+ +
var name = o && o.getName();
+
+ +

vagy értékek cachelésére (ha a falsy értékek érvénytelenek):

+ +
var name = cachedName || (cachedName = getName());
+
+ +

A JavaScript-ben van egy ternáris operátor, feltételek létrehozásához:

+ +
var allowed = (age > 18) ? 'yes' : 'no';
+
+ +

switch többszörös elágazásakhoz használható egy string vagy egy szám tartalmától függően:

+ +
switch (action) {
+  case 'draw':
+    drawIt();
+    break;
+  case 'eat':
+    eatIt();
+    break;
+  default:
+    doNothing();
+}
+
+ +

Ha nem adunk hozzá break utasítást, a vezérlés átlép a következő case ágra. Ezt ritka esetekben használják  — ilyenkor megéri egy kommentet hozzáfűzni, hogy a későbbi hibakeresést megkönnyítse:

+ +
switch (a) {
+  case 1: // átlép a következőre
+  case 2:
+    eatIt();
+    break;
+  default:
+    doNothing();
+}
+
+ +

A default ág nem kötelező. Ha szeretnénk a switch részben, és az case részben is lehetnek utasítások; Az összehasonlítás a kettő között a === operátorral történik:

+ +
switch (1 + 3) {
+  case 2 + 2:
+    yay();
+    break;
+  default:
+    sosemtortenikmeg();
+}
+
+ +

Objektumok

+ +

A JavaScript objektumok egyszerű név - érték párokból állnak. Ezek hasonlóak mint a:

+ +
    +
  • Python Szótárak.
  • +
  • Perl és Ruby Hash-ek.
  • +
  • C és C++ Hash táblák.
  • +
  • Java HashMaps .
  • +
  • PHP asszociatív tömbök .
  • +
+ +

Az a tény, hogy ezt az adatstruktúrát olyan széles körben alkalmazzák, a sokoldalúságát bizonyítja. Mivel a JavaScriptben minden (a tiszta core típusok) egy objektum, úgy természetesen minden JavaScript program egy csomó keresési műveletet végez el a hash-táblákban. Jó hogy ezek ilyen gyorsak!

+ +

A "név" rész az egy JavaScript string, az érték viszont bármilyen JavaScript érték lehet, beleértve más objektumokat is. Ez lehetővé teszi a tetszőlegesen összetett adatstruktúrák létrehozását.

+ +

Egy üres objektum létrehozására két lehetőség van:

+ +
var obj = new Object();
+
+ +

és:

+ +
var obj = {};
+
+ +

Ezek szemantikailag egyformák; a másodikat object literal szintaxisnak hívják, és elterjedtebb. Ez a szintaxis a magja a JSON formátumnak is.

+ +

Az Object literal szintaxis egy átfogó objektum inicializálására használható:

+ +
var obj = {
+  name: 'Carrot',
+  for: 'Max', // 'for' egy foglalt szó, használjunk '_for' -t helyette.
+  details: {
+    color: 'orange',
+    size: 12
+  }
+};
+
+ +

A tulajdonságok elérése összefűzhető:

+ +
obj.details.color; // orange
+obj['details']['size']; // 12
+
+ +

A kövekező példa egy  Person prototípust készít, és ezen prototípusnak egy you nevű példányát.

+ +
function Person(name, age) {
+  this.name = name;
+  this.age = age;
+}
+
+// Define an object
+var you = new Person('You', 24);
+// We are creating a new person named "You" aged 24.
+
+
+ +

Példányosítás után, egy objektum tulajdonságait két féle képpen lehet elérni:

+ +
// dot notation
+obj.name = 'Simon';
+var name = obj.name;
+
+ +

és...

+ +
// bracket notation
+obj['name'] = 'Simon';
+var name = obj['name'];
+// egy változó használható kulcs létrehozására
+var user = prompt('what is your key?')
+obj[user] = prompt('what is its value?')
+
+ +

Ezek szemantikailag egyformák. A második módszer előnye, hogy a tulajdonság nevét stringként lehet megadni, ami azt jelenti, hogy futási időben dől el. Ám ez a módszer megakadályozza néhány JavaScript motor és minifier optimalizáció végrehajtását. Ez a módszer arra is alkalmazható, hogy olyan tulajdoságokat létrehozhassunk, és elérjünk amik  foglalt szavakat használnak.

+ +
obj.for = 'Simon'; // Syntax error, mert a 'for' egy foglalt szó
+obj['for'] = 'Simon'; // működik
+
+ +
+

Az ECMAScript 5-től kezdve, a foglalt szavak is használhatóak az objektumliterálokban. ez azt jelenti, hogy nem kell "idézőjelek kozé" tenni. Lásd ES5 Spec.

+
+ +

További információk az objektumokról, és prototípusokról a Object.prototype cikkben olvashatóak. Az obejktumprototípusok, és az objektumprototípus-láncok  magyarűzatáhpz lásd az Inheritance and the prototype chain cikket.

+ +
+

Az ECMAScript 5-től kezdve, az objektumok névpárját  (kulcsait) szögletes zárójelek közé tett változóval is lehet használni {[phoneType]: 12345}, nem csak így:  var userPhone = {}; userPhone[phoneType] = 12345.

+
+ +

Tömbök

+ +

A tömbök a JavaScriptben az objektumok egy különleges fajtája. Messzemenőkig úgy működnek mint a normális objektumok, (A numerikus tulajdonságok csak a [] szintaxissal érhetőek el) de van egy plusz tulajdonságuk is, a 'length'. Ez mindigy egyel több, mint a legmagasabb index a tömbben.

+ +

Egy tömböt a következő képpen lehet létrehozni:

+ +
var a = new Array();
+a[0] = 'dog';
+a[1] = 'cat';
+a[2] = 'hen';
+a.length; // 3
+
+ +

Még népszerűbb ezen a módon egy literállal.

+ +
var a = ['dog', 'cat', 'hen'];
+a.length; // 3
+
+ +

Tartsuk észben, hogy az array.length nem feltétlenül az elemek számát jelenti. Nézzük a következő példát:

+ +
var a = ['dog', 'cat', 'hen'];
+a[100] = 'fox';
+a.length; // 101
+
+ +

Ne feledjük: a tömb hossza (length) mindig a legmagasabb index + 1 értéket jelenti.

+ +

Ha egy nem létező indexhez próbálunk hozzáférni, akkor undefined értéket kapunk vissza:

+ +
typeof a[90]; // undefined
+
+ +

A fenti [] -ket és a length tulajdonságot használva, végiglépkedhetünk a tömbön a következő for ciklus segítségével:

+ +
for (var i = 0; i < a.length; i++) {
+  // a[i] feldolgozása
+}
+
+ +

Az ES2015 óta a fenti módszernek létezik egy egyszerűbb formája is, a for...of ciklus, ami olyan objektumoknál használható, mint a tömbök:

+ +
for (const currentValue of a) {
+  // currentValue feldolgozása
+}
+ +

Egy  for...in ciklussal is végig lehet lépkedni egy tömbön, ám ez nem a tömb elemein lépked végig, hanem a tömb indexein. Továbbá, ha valaki új tulajdonságokat ad hozzá az Array.prototype-hoz, akkor azokon is egy ilyen ciklus lépkedne végig. Emiatt ez a fajta ciklus nem ajánlott tömbök iterálására.

+ +

Az ECMAScript 5-ben egy másik módszer is adott, hogy végig lépkedjünk egy tömbön, a forEach():

+ +
['dog', 'cat', 'hen'].forEach(function(currentValue, index, array) {
+  // currentValue vagy array[index] feldolgozása
+});
+
+ +

Ha egy elemt szeretnénk a tömbhöz hozzáadni, egyszerűen így tehetjük meg:

+ +
a.push(item);
+ +

Egy tömbnek sok metódusa van. Lásd a full documentation for array methods cikket is.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method nameDescription
a.toString()Egy stringet ad vissza, amiben minden objektum veszzővel van elválasztva. 
a.toLocaleString()Egy stringet ad vissza, amiben minden objektum veszzővel van elválasztva, dátumoknál a helyi idő szerinti formátum
a.concat(item1[, item2[, ...[, itemN]]])Egy új tömböt ad vissza, a hozzáadott elemekkel együtt.
a.join(sep)Egy stringé alakítja át a tömböt, amiben a sep paraméterben megadottal lesznek az egyes elemek elválasztva
a.pop()Eltávolítja az utolsó elemet, és visszaadja azt.
a.push(item1, ..., itemN)A tömb végére hozzáfűz egy elemet
a.reverse()Megfordítja a tömb sorrendjét.
a.shift()Eltávolítja az első elemet, és visszaadja azt.
a.slice(start[, end])Egy altömböt ad vissza.
a.sort([cmpfn])Rendezi a tömböt. Opcionálisan egy függvényt is meg lehet adni.
a.splice(start, delcount[, item1[, ...[, itemN]]])Módosít egy tömböt úgy, hogy egy része törölve, és azok több elemekkel cserélve lesznek.
a.unshift(item1[, item2[, ...[, itemN]]])A tömb elejére elemeket szúr be.
+ +

Függvények

+ +

Az objektumok mellet, a függvények a JavaScript központi összetevői. Egy egyszerű függvény szintaxisa alig lehetne egyszerűebb:

+ +
function add(x, y) {
+  var total = x + y;
+  return total;
+}
+
+ +

Ez egy egyszerű függvényt mutat be. Egy JavaScript függvénynek 0 vagy több megnevezett paramétere lehet. A függvény törzse tetszüleges számú utasítást tartalmazhat, és egyéni lokális változók is deklarálhatóak benne. A return utasítás bárhol használható értékek visszaadására, és a függvény befejezésére. ha nem használunk return utasítást, (vagy érték nélkül használjuk), a függvény visszatérése undefined lesz.

+ +

A megnevezett paraméterek inkább ajánlás, mint kötelezően megadandó adatok. A függvények meghívhatóak a várt paraméterek nélkül is, ez esetben azok értéke undefined lesz.

+ +
add(); // NaN
+// Nem lehet hozzáadást végezni undefined értékekkel
+
+ +

You can also pass in more arguments than the function is expecting:

+ +
add(2, 3, 4); // 5
+// az első két paraméter össze lesz adva; a 4 figyelmen kívül marad
+
+ +

Talán egy kicsit furcsának tűnhet, de a függvények a függvénytörzsben hozzáférnek egy plusz változóhoz is, az arguments-hez, ami egy tömb szerű objektum, és a megadott paramétereket tartalmazza. Írjuk újra a függvényt úgy hogy tetszőleges számú paramétert dolgozzon fel:

+ +
function add() {
+  var sum = 0;
+  for (var i = 0, j = arguments.length; i < j; i++) {
+    sum += arguments[i];
+  }
+  return sum;
+}
+
+add(2, 3, 4, 5); // 14
+
+ +

Ám ez nem hasznosabb annál, mint leírni, hogy 2 + 3 + 4 + 5. Készítsünk egy átlagszámítást végző függvényt:

+ +
function avg() {
+  var sum = 0;
+  for (var i = 0, j = arguments.length; i < j; i++) {
+    sum += arguments[i];
+  }
+  return sum / arguments.length;
+}
+
+avg(2, 3, 4, 5); // 3.5
+
+ +

Ez nagyon hasznos, mégis egy kicsit hosszúnak látszik. Hogy lerövidíthessük egy kicsit jobban a kódot, az arguments tömb használatát a Rest parameter syntax -ra is cserélhetjük, így tetszőleges sok paraméter adható át, és a kód minimális marad. A függvényekben a rest parameter operator a ...variable formátummal írható le, és tartalmazza a függvény számára összes nem megnevezett paramétert. A for ciklus helyett használhatunk for...of ciklust is.

+ +
function avg(...args) {
+  var sum = 0;
+  for (let value of args) {
+    sum += value;
+  }
+  return sum / args.length;
+}
+
+avg(2, 3, 4, 5); // 3.5
+
+ +
A fenti kódban, az args változó tárolja az összes értéket, amit a függvénynek adtunk át.
+
+It is important to note that wherever the rest parameter operator is placed in a function declaration it will store all arguments after its declaration, but not before. i.e. function avg(firstValue, ...args) will store the first value passed into the function in the firstValue variable and the remaining arguments in args. That's another useful language feature but it does lead us to a new problem. The avg() function takes a comma-separated list of arguments — but what if you want to find the average of an array? You could just rewrite the function as follows:
+ +
function avgArray(arr) {
+  var sum = 0;
+  for (var i = 0, j = arr.length; i < j; i++) {
+    sum += arr[i];
+  }
+  return sum / arr.length;
+}
+
+avgArray([2, 3, 4, 5]); // 3.5
+
+ +

But it would be nice to be able to reuse the function that we've already created. Luckily, JavaScript lets you call a function with an arbitrary array of arguments, using the {{jsxref("Function.apply", "apply()")}} method of any function object.

+ +
avg.apply(null, [2, 3, 4, 5]); // 3.5
+
+ +

The second argument to apply() is the array to use as arguments; the first will be discussed later on. This emphasizes the fact that functions are objects too.

+ +
+

You can achieve the same result using the spread operator in the function call.

+ +

For instance: avg(...numbers)

+
+ +

JavaScript lets you create anonymous functions.

+ +
var avg = function() {
+  var sum = 0;
+  for (var i = 0, j = arguments.length; i < j; i++) {
+    sum += arguments[i];
+  }
+  return sum / arguments.length;
+};
+
+ +

This is semantically equivalent to the function avg() form. It's extremely powerful, as it lets you put a full function definition anywhere that you would normally put an expression. This enables all sorts of clever tricks. Here's a way of "hiding" some local variables — like block scope in C:

+ +
var a = 1;
+var b = 2;
+
+(function() {
+  var b = 3;
+  a += b;
+})();
+
+a; // 4
+b; // 2
+
+ +

JavaScript allows you to call functions recursively. This is particularly useful for dealing with tree structures, such as those found in the browser DOM.

+ +
function countChars(elm) {
+  if (elm.nodeType == 3) { // TEXT_NODE
+    return elm.nodeValue.length;
+  }
+  var count = 0;
+  for (var i = 0, child; child = elm.childNodes[i]; i++) {
+    count += countChars(child);
+  }
+  return count;
+}
+
+ +

This highlights a potential problem with anonymous functions: how do you call them recursively if they don't have a name? JavaScript lets you name function expressions for this. You can use named IIFEs (Immediately Invoked Function Expressions) as shown below:

+ +
var charsInBody = (function counter(elm) {
+  if (elm.nodeType == 3) { // TEXT_NODE
+    return elm.nodeValue.length;
+  }
+  var count = 0;
+  for (var i = 0, child; child = elm.childNodes[i]; i++) {
+    count += counter(child);
+  }
+  return count;
+})(document.body);
+
+ +

The name provided to a function expression as above is only available to the function's own scope. This allows more optimizations to be done by the engine and results in more readable code. The name also shows up in the debugger and some stack traces, which can save you time when debugging.

+ +

Note that JavaScript functions are themselves objects — like everything else in JavaScript — and you can add or change properties on them just like we've seen earlier in the Objects section.

+ +

Custom objects

+ +
For a more detailed discussion of object-oriented programming in JavaScript, see Introduction to Object-Oriented JavaScript.
+ +

In classic Object Oriented Programming, objects are collections of data and methods that operate on that data. JavaScript is a prototype-based language that contains no class statement, as you'd find in C++ or Java (this is sometimes confusing for programmers accustomed to languages with a class statement). Instead, JavaScript uses functions as classes. Let's consider a person object with first and last name fields. There are two ways in which the name might be displayed: as "first last" or as "last, first". Using the functions and objects that we've discussed previously, we could display the data like this:

+ +
function makePerson(first, last) {
+  return {
+    first: first,
+    last: last
+  };
+}
+function personFullName(person) {
+  return person.first + ' ' + person.last;
+}
+function personFullNameReversed(person) {
+  return person.last + ', ' + person.first;
+}
+
+var s = makePerson('Simon', 'Willison');
+personFullName(s); // "Simon Willison"
+personFullNameReversed(s); // "Willison, Simon"
+
+ +

This works, but it's pretty ugly. You end up with dozens of functions in your global namespace. What we really need is a way to attach a function to an object. Since functions are objects, this is easy:

+ +
function makePerson(first, last) {
+  return {
+    first: first,
+    last: last,
+    fullName: function() {
+      return this.first + ' ' + this.last;
+    },
+    fullNameReversed: function() {
+      return this.last + ', ' + this.first;
+    }
+  };
+}
+
+var s = makePerson('Simon', 'Willison');
+s.fullName(); // "Simon Willison"
+s.fullNameReversed(); // "Willison, Simon"
+
+ +

There's something here we haven't seen before: the this keyword. Used inside a function, this refers to the current object. What that actually means is specified by the way in which you called that function. If you called it using dot notation or bracket notation on an object, that object becomes this. If dot notation wasn't used for the call, this refers to the global object.

+ +

Note that this is a frequent cause of mistakes. For example:

+ +
var s = makePerson('Simon', 'Willison');
+var fullName = s.fullName;
+fullName(); // undefined undefined
+
+ +

When we call fullName() alone, without using s.fullName(), this is bound to the global object. Since there are no global variables called first or last we get undefined for each one.

+ +

We can take advantage of the this keyword to improve our makePerson function:

+ +
function Person(first, last) {
+  this.first = first;
+  this.last = last;
+  this.fullName = function() {
+    return this.first + ' ' + this.last;
+  };
+  this.fullNameReversed = function() {
+    return this.last + ', ' + this.first;
+  };
+}
+var s = new Person('Simon', 'Willison');
+
+ +

We have introduced another keyword: new. new is strongly related to this. It creates a brand new empty object, and then calls the function specified, with this set to that new object. Notice though that the function specified with this does not return a value but merely modifies the this object. It's new that returns the this object to the calling site. Functions that are designed to be called by new are called constructor functions. Common practice is to capitalize these functions as a reminder to call them with new.

+ +

The improved function still has the same pitfall with calling fullName() alone.

+ +

Our person objects are getting better, but there are still some ugly edges to them. Every time we create a person object we are creating two brand new function objects within it — wouldn't it be better if this code was shared?

+ +
function personFullName() {
+  return this.first + ' ' + this.last;
+}
+function personFullNameReversed() {
+  return this.last + ', ' + this.first;
+}
+function Person(first, last) {
+  this.first = first;
+  this.last = last;
+  this.fullName = personFullName;
+  this.fullNameReversed = personFullNameReversed;
+}
+
+ +

That's better: we are creating the method functions only once, and assigning references to them inside the constructor. Can we do any better than that? The answer is yes:

+ +
function Person(first, last) {
+  this.first = first;
+  this.last = last;
+}
+Person.prototype.fullName = function() {
+  return this.first + ' ' + this.last;
+};
+Person.prototype.fullNameReversed = function() {
+  return this.last + ', ' + this.first;
+};
+
+ +

Person.prototype is an object shared by all instances of Person. It forms part of a lookup chain (that has a special name, "prototype chain"): any time you attempt to access a property of Person that isn't set, JavaScript will check Person.prototype to see if that property exists there instead. As a result, anything assigned to Person.prototype becomes available to all instances of that constructor via the this object.

+ +

This is an incredibly powerful tool. JavaScript lets you modify something's prototype at any time in your program, which means you can add extra methods to existing objects at runtime:

+ +
var s = new Person('Simon', 'Willison');
+s.firstNameCaps(); // TypeError on line 1: s.firstNameCaps is not a function
+
+Person.prototype.firstNameCaps = function() {
+  return this.first.toUpperCase();
+};
+s.firstNameCaps(); // "SIMON"
+
+ +

Interestingly, you can also add things to the prototype of built-in JavaScript objects. Let's add a method to String that returns that string in reverse:

+ +
var s = 'Simon';
+s.reversed(); // TypeError on line 1: s.reversed is not a function
+
+String.prototype.reversed = function() {
+  var r = '';
+  for (var i = this.length - 1; i >= 0; i--) {
+    r += this[i];
+  }
+  return r;
+};
+
+s.reversed(); // nomiS
+
+ +

Our new method even works on string literals!

+ +
'This can now be reversed'.reversed(); // desrever eb won nac sihT
+
+ +

As mentioned before, the prototype forms part of a chain. The root of that chain is Object.prototype, whose methods include toString() — it is this method that is called when you try to represent an object as a string. This is useful for debugging our Person objects:

+ +
var s = new Person('Simon', 'Willison');
+s.toString(); // [object Object]
+
+Person.prototype.toString = function() {
+  return '<Person: ' + this.fullName() + '>';
+}
+
+s.toString(); // "<Person: Simon Willison>"
+
+ +

Remember how avg.apply() had a null first argument? We can revisit that now. The first argument to apply() is the object that should be treated as 'this'. For example, here's a trivial implementation of new:

+ +
function trivialNew(constructor, ...args) {
+  var o = {}; // Create an object
+  constructor.apply(o, args);
+  return o;
+}
+
+ +

This isn't an exact replica of new as it doesn't set up the prototype chain (it would be difficult to illustrate). This is not something you use very often, but it's useful to know about. In this snippet, ...args (including the ellipsis) is called the "rest arguments" — as the name implies, this contains the rest of the arguments.

+ +

Calling

+ +
var bill = trivialNew(Person, 'William', 'Orange');
+ +

is therefore almost equivalent to

+ +
var bill = new Person('William', 'Orange');
+ +

apply() has a sister function named call, which again lets you set this but takes an expanded argument list as opposed to an array.

+ +
function lastNameCaps() {
+  return this.last.toUpperCase();
+}
+var s = new Person('Simon', 'Willison');
+lastNameCaps.call(s);
+// Is the same as:
+s.lastNameCaps = lastNameCaps;
+s.lastNameCaps(); // WILLISON
+
+ +

Inner functions

+ +

JavaScript function declarations are allowed inside other functions. We've seen this once before, with an earlier makePerson() function. An important detail of nested functions in JavaScript is that they can access variables in their parent function's scope:

+ +
function parentFunc() {
+  var a = 1;
+
+  function nestedFunc() {
+    var b = 4; // parentFunc can't use this
+    return a + b;
+  }
+  return nestedFunc(); // 5
+}
+
+ +

This provides a great deal of utility in writing more maintainable code. If a called function relies on one or two other functions that are not useful to any other part of your code, you can nest those utility functions inside it. This keeps the number of functions that are in the global scope down, which is always a good thing.

+ +

This is also a great counter to the lure of global variables. When writing complex code it is often tempting to use global variables to share values between multiple functions — which leads to code that is hard to maintain. Nested functions can share variables in their parent, so you can use that mechanism to couple functions together when it makes sense without polluting your global namespace — "local globals" if you like. This technique should be used with caution, but it's a useful ability to have.

+ +

Closures

+ +

This leads us to one of the most powerful abstractions that JavaScript has to offer — but also the most potentially confusing. What does this do?

+ +
function makeAdder(a) {
+  return function(b) {
+    return a + b;
+  };
+}
+var x = makeAdder(5);
+var y = makeAdder(20);
+x(6); // ?
+y(7); // ?
+
+ +

The name of the makeAdder() function should give it away: it creates new 'adder' functions, each of which, when called with one argument, adds it to the argument that it was created with.

+ +

What's happening here is pretty much the same as was happening with the inner functions earlier on: a function defined inside another function has access to the outer function's variables. The only difference here is that the outer function has returned, and hence common sense would seem to dictate that its local variables no longer exist. But they do still exist — otherwise, the adder functions would be unable to work. What's more, there are two different "copies" of makeAdder()'s local variables — one in which a is 5 and the other one where a is 20. So the result of that function calls is as follows:

+ +
x(6); // returns 11
+y(7); // returns 27
+
+ +

Here's what's actually happening. Whenever JavaScript executes a function, a 'scope' object is created to hold the local variables created within that function. It is initialized with any variables passed in as function parameters. This is similar to the global object that all global variables and functions live in, but with a couple of important differences: firstly, a brand new scope object is created every time a function starts executing, and secondly, unlike the global object (which is accessible as this and in browsers as window) these scope objects cannot be directly accessed from your JavaScript code. There is no mechanism for iterating over the properties of the current scope object, for example.

+ +

So when makeAdder() is called, a scope object is created with one property: a, which is the argument passed to the makeAdder() function. makeAdder() then returns a newly created function. Normally JavaScript's garbage collector would clean up the scope object created for makeAdder() at this point, but the returned function maintains a reference back to that scope object. As a result, the scope object will not be garbage-collected until there are no more references to the function object that makeAdder() returned.

+ +

Scope objects form a chain called the scope chain, similar to the prototype chain used by JavaScript's object system.

+ +

A closure is the combination of a function and the scope object in which it was created. Closures let you save state — as such, they can often be used in place of objects. You can find several excellent introductions to closures.

diff --git "a/files/hu/web/javascript/guide/bevezet\303\251s/index.html" "b/files/hu/web/javascript/guide/bevezet\303\251s/index.html" new file mode 100644 index 0000000000..3e87f3d12b --- /dev/null +++ "b/files/hu/web/javascript/guide/bevezet\303\251s/index.html" @@ -0,0 +1,134 @@ +--- +title: Bevezetés +slug: Web/JavaScript/Guide/Bevezetés +translation_of: Web/JavaScript/Guide/Introduction +--- +
{{jsSidebar("JavaScript Guide")}} {{PreviousNext("Web/JavaScript/Guide", "Web/JavaScript/Guide/Grammar_and_types")}}
+ +

Ez a fejezet bemutatja a JavaScript-et és hozzá kapcsolódó néhány alapvető fogalmat.

+ +

Amire szükséged lesz a megértéshez

+ +

Ez az útmutató feltételezi, hogy a következő alapvető háttérrel rendelkezel:

+ +
    +
  • Általános ismeret az internet és a World Wide Web ({{Glossary("WWW")}}) működéséről.
  • +
  • Megfelelő gyakorlati ismeretek a HyperText Markup Language, az az ({{Glossary("HTML")}}) nyelvet kapcsolatban.
  • +
  • Alapszintű programozási tapasztalat. Amennyiben kezdő programozó vagy, akkor próbálkozz meg az oktatóanyagokkal a fő oldalon JavaScript.
  • +
+ +

További információk a JavaScript-ről

+ +

A JavaScript dokumentáció a következőket tartalmazza:

+ + + +

Ha kezdő JavaScript programozó vagy, akkor jó helyen jársz, a JavaScript Útmutatóban elsajátíthatod a keresett tudást. Ha már alap szinten ismered a nyelvet, egyszerűbb lehet számodra a JavaScript Referencia, ahol szakmai információkat olvashatsz.

+ +

Mi az a JavaScript?

+ +

A JavaScript egy platform független (cross-platform), objektum orientált script nyelv. Beépített környezetben fut (általában egy web böngésző), JavaScript képes kapcsolódni más objektum környezettel (DOM, lásd később), ezáltal tudja manipulálni azt.

+ +

JavaScript tartalmaz egy szabványos objektum könyvtárat, mint például az Array, Date, és Math, és alapvető nyelvi elemeket, például az operátorokat és vezérlési szerkezeteket. JavaScript-et lehet bővíteni különböző célokra történő kiegészítéssel, annak speciális igényeivel, például:

+ +
    +
  • Kliens oldali JavaScript kiterjeszti az alapvető nyelvi elemeket olyan objektumokkal, mely képes egy böngészőben manipulálni a Document Object Model-t (HTML DOM). Például, lehetővé teszi, hogy egy HTML űrlapon reagál a felhasználói eseményekre, mint a kattintás vagy a bevitt adatok ellenőrzése.
  • +
  • Szerver oldali JavaScript kiterjeszti az alapvető nyelvi elemeket olyan objektumokkal, mely érdemessé teszi, hogy fusson egy szerveren. Például, lehetővé teszi, hogy kommunikáljon egy adatbázissalvagy végezhessen fájlmanipulációkat a szerveren.
  • +
+ +

JavaScript and Java

+ +

JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.

+ +

In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.

+ +

JavaScript is a very free-form language compared to Java. You do not have to declare all variables, classes, and methods. You do not have to be concerned with whether methods are public, private, or protected, and you do not have to implement interfaces. Variables, parameters, and function return types are not explicitly typed.

+ +

Java is a class-based programming language designed for fast execution and type safety. Type safety means, for instance, that you can't cast a Java integer into an object reference or access private memory by corrupting Java bytecodes. Java's class-based model means that programs consist exclusively of classes and their methods. Java's class inheritance and strong typing generally require tightly coupled object hierarchies. These requirements make Java programming more complex than JavaScript programming.

+ +

In contrast, JavaScript descends in spirit from a line of smaller, dynamically typed languages such as HyperTalk and dBASE. These scripting languages offer programming tools to a much wider audience because of their easier syntax, specialized built-in functionality, and minimal requirements for object creation.

+ + + + + + + + + + + + + + + + + + + + + + + +
JavaScript compared to Java
JavaScriptJava
Object-oriented. No distinction between types of objects. Inheritance is through the prototype mechanism, and properties and methods can be added to any object dynamically.Class-based. Objects are divided into classes and instances with all inheritance through the class hierarchy. Classes and instances cannot have properties or methods added dynamically.
Variable data types are not declared (dynamic typing).Variable data types must be declared (static typing).
Cannot automatically write to hard disk.Can automatically write to hard disk.
+ +

For more information on the differences between JavaScript and Java, see the chapter Details of the object model.

+ +

JavaScript and the ECMAScript specification

+ +

JavaScript is standardized at Ecma International — the European association for standardizing information and communication systems (ECMA was formerly an acronym for the European Computer Manufacturers Association) to deliver a standardized, international programming language based on JavaScript. This standardized version of JavaScript, called ECMAScript, behaves the same way in all applications that support the standard. Companies can use the open standard language to develop their implementation of JavaScript. The ECMAScript standard is documented in the ECMA-262 specification. See New in JavaScript to learn more about different versions of JavaScript and ECMAScript specification editions.

+ +

The ECMA-262 standard is also approved by the ISO (International Organization for Standardization) as ISO-16262. You can also find the specification on the Ecma International website. The ECMAScript specification does not describe the Document Object Model (DOM), which is standardized by the World Wide Web Consortium (W3C) and/or WHATWG (Web Hypertext Application Technology Working Group). The DOM defines the way in which HTML document objects are exposed to your script. To get a better idea about the different technologies that are used when programming with JavaScript, consult the article JavaScript technologies overview.

+ +

JavaScript documentation versus the ECMAScript specification

+ +

The ECMAScript specification is a set of requirements for implementing ECMAScript; it is useful if you want to implement standards-compliant language features in your ECMAScript implementation or engine (such as SpiderMonkey in Firefox, or v8 in Chrome).

+ +

The ECMAScript document is not intended to help script programmers; use the JavaScript documentation for information on writing scripts.

+ +

The ECMAScript specification uses terminology and syntax that may be unfamiliar to a JavaScript programmer. Although the description of the language may differ in ECMAScript, the language itself remains the same. JavaScript supports all functionality outlined in the ECMAScript specification.

+ +

The JavaScript documentation describes aspects of the language that are appropriate for a JavaScript programmer.

+ +

Getting started with JavaScript

+ +

Getting started with JavaScript is easy: all you need is a modern Web browser. This guide includes some JavaScript features which are only currently available in the latest versions of Firefox, so using the most recent version of Firefox is recommended.

+ +

There are two tools built into Firefox that are useful for experimenting with JavaScript: the Web Console and Scratchpad.

+ +

The Web Console

+ +

The Web Console shows you information about the currently loaded Web page, and also includes a command line that you can use to execute JavaScript expressions in the current page.

+ +

To open the Web Console (Ctrl+Shift+K), select "Web Console" from the "Developer" menu, which is under the "Tools" menu in Firefox. It appears at the bottom of the browser window. Along the bottom of the console is a command line that you can use to enter JavaScript, and the output appears in the pane above:

+ +

+ +

Scratchpad

+ +

The Web Console is great for executing single lines of JavaScript, but although you can execute multiple lines, it's not very convenient for that, and you can't save your code samples using the Web Console. So for more complex examples Scratchpad is a better tool.

+ +

To open Scratchpad (Shift+F4), select "Scratchpad" from the "Developer" menu, which is under the menu in Firefox. It opens in a separate window and is an editor that you can use to write and execute JavaScript in the browser. You can also save scripts to disk and load them from disk.

+ +

+ +

Hello world

+ +

To get started with writing JavaScript, open the Scratchpad and write your first "Hello world" JavaScript code:

+ +
function greetMe(yourName) {
+  alert("Hello " + yourName);
+}
+
+greetMe("World");
+
+ +

Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!

+ +

In the following pages, this guide will introduce you to the JavaScript syntax and language features, so that you will be able to write more complex applications.

+ +

{{PreviousNext("Web/JavaScript/Guide", "Web/JavaScript/Guide/Grammar_and_types")}}

diff --git a/files/hu/web/javascript/guide/index.html b/files/hu/web/javascript/guide/index.html new file mode 100644 index 0000000000..be58db535b --- /dev/null +++ b/files/hu/web/javascript/guide/index.html @@ -0,0 +1,122 @@ +--- +title: JavaScript kézikönyv +slug: Web/JavaScript/Guide +tags: + - AJAX + - JavaScript + - JavaScript_Guide + - NeedsMarkupWork +translation_of: Web/JavaScript/Guide +--- +
{{jsSidebar("JavaScript Guide")}}
+ +

The JavaScript Guide shows you how to use JavaScript and gives an overview of the language. If you want to get started with JavaScript or programming in general, consult the articles in the learning area. If you need exhaustive information about a language feature, have a look at the JavaScript reference.

+ + + + + + + + + +

{{Next("Web/JavaScript/Guide/Introduction")}}

diff --git a/files/hu/web/javascript/index.html b/files/hu/web/javascript/index.html new file mode 100644 index 0000000000..10ef5cc33c --- /dev/null +++ b/files/hu/web/javascript/index.html @@ -0,0 +1,110 @@ +--- +title: JavaScript +slug: Web/JavaScript +tags: + - Főoldal + - JavaScript + - Tanulás + - 'l10n:priority' +translation_of: Web/JavaScript +--- +

A JavaScript (JS) egy kis erőforrás-igényű, értelmezett vagy JIT-fordított programozási nyelv {{Glossary("Első osztályú funkciók", "elsőrendű függvényekkel")}}. Bár legtöbben weboldalak parancsnyelveként ismerik, sok webböngészőn kívüli környezetben is használják. Ilyen a node.js, az Apache CouchDB és az Adobe Acrobat. A JavaScript egy {{Glossary("Prototype-based programming", "prototípus-alapú")}}, többparadigmás, dinamikus nyelv, ami támogatja az objektumorientált, imperatív és deklaratív (pl. funkcionális) programozási stílusokat. Többet itt olvashat a JavaScriptről.

+ +

Az oldal ezen része magáról a JavaScript nyelvről szól, nem a különböző weboldalaktól és környezetektől függő részekről. A weboldalaktól függő {{Glossary("API","API")}}-król lásd: Web-API-k és a DOM.

+ +

A JavaScript szabványa az ECMAScript. 2012-től kezdődően, mindegyik modern böngésző támogatja az ECMAScript 5.1.-et. Régebbi böngészők legalább az ECMAScript 3-at támogatják. 2015. június 17-én az ECMA International kiadta az ECMAScript hatodik jelentősebb verzióját, amit hivatalosan ECMAScript 2015-nek neveznek, de eleinte az ECMAScript 6 és az ES6 nevekkel illették. Azóta az ECMAScript szabványokat éves ciklusokban adják ki. Ez a dokumentáció a legújabb tervezetre vonatkozik, ami jelenleg az ECMAScript 2019.

+ +

A JavaScript nem összetévesztendő a  Java programozási nyevvel. A "Java" és a "JavaScript" is az Oracle USA-ban és sok más országban regisztrált védjegye. Ettől függetlenül a két programozási nyelv szintaktikája, szematikája és alkalmazása jelentős mértékben eltér.

+ +
+
+

Oktatóanyagok

+ +

Tanulja meg a JavaScript-ben történő programozást útmutatók és bemutatók segítségével.

+ +

Teljes kezdőknek

+ +

Látogassa meg a Tanulási területünk JavaScript tárgyát ha nem rendekezik JavaScript vagy másféle programozási tapasztalattal. Ott megtalálhatóak az alábbi modulok:

+ +
+
JavaScript első lépések
+
Az olyan kérdések megválaszolása, mint "mi a JavaScript?", "hogy néz ki?", és "mire képes?", emellett a JavaScript fő funkciójainak ismertetése, mint a változók, stringek, számok és tömbök.
+
JavaScript építőkockák
+
Folytatja a JavaScript alapvető fő funkcióinak beszámolóját a figyelmet a gyakran előforduló típusú kód blokkok felé fordítva, mint az elágazások, ciklusok, függvények, és az esetek.
+
A JavaScript objektumok bemutatása
+
A JavaScript objektumorientált jellegének megértése fontos, ha további tudást szeretne szerezni a nyelvről és ha hatékonyabb kódot szeretne írni. Ezért hoztuk létre ezt a modult, hogy segítsünk.
+
+ +

JavaScript útmutató

+ +
+
JavaScript útmutató
+
Egy sokkal részletesebb útmutató a JavaScript nyelvhez, amit olyanoknak szántunk, akik rendelkeznek már JavaScript vagy más programozási tapasztalattal.
+
+ +

Középszint

+ +
+
A JavaScript újbóli bemutatása
+
Egy áttekintés azoknak, akik azt gondolják hogy ismerik JavaScript-et.
+
+ +
+
JavaScript adatstruktúrák
+
A JavaScript-ben elérhető adatstruktúrák áttekintése.
+
Egyenlőség és azonosság
+
A JavaScript-ben háromféle értékösszehasonító műveletet érhetünk el: a szigorú egyenlőséget a === hasznlatával, a laza egyenlőséget a  == használatával, és az {{jsxref("Global_Objects/Object/is", "Object.is()")}} függvényt.
+
+ +

Haladó

+ +
+
Öröklődés és a prototípus lánc
+
A széleskörben félreértett és alábecsült prototípus alapú öröklődés értelmezése.
+
Szigorú mód
+
A szigorú mód meghatározza, hogy nem lehet használni egy változót az inicializálását megelőzően. Ez az ECMAScript 5 egy korlátozott változata, a gyorsabb teljesítmény és könnyebb hibakeresés érdekében.
+
JavaScript tipizált tömbök
+
A JavaScript tipizált tömbök lehetővé teszik a nyers bináris adatok elérését.
+
Memóriakezelés
+
A memória életciklus és a szemétgyűjtés JavaScript-ben.
+
A párhuzamos modell és az eseményciklus
+
JavaScript-ben van egy párhuzamos modell, ami egy "eseménycikluson" alapszik.
+
+
+ +
+

Referencia

+ +

A JavaScript referencia documentáció böngészése.

+ +
+
Az alapértelmezett objektumok
+
Ismerje meg az alapértelmezett beépített objektumokat: {{jsxref("Array")}}, {{jsxref("Boolean")}}, {{jsxref("Date")}}, {{jsxref("Error")}}, {{jsxref("Function")}}, {{jsxref("JSON")}}, {{jsxref("Math")}}, {{jsxref("Number")}}, {{jsxref("Object")}}, {{jsxref("RegExp")}}, {{jsxref("String")}}, {{jsxref("Map")}}, {{jsxref("Set")}}, {{jsxref("WeakMap")}}, {{jsxref("WeakSet")}}, és másokat.
+
Kifejezések és operátorok
+
Tudjon meg többet a JavaScript operátoroktól: {{jsxref("Operators/instanceof", "instanceof")}}, {{jsxref("Operators/typeof", "typeof")}}, {{jsxref("Operators/new", "new")}}, {{jsxref("Operators/this", "this")}}, az operátor elsőbbségről, és másokról.
+
Állítások
+
Ismerje meg, hogyan működnek a {{jsxref("Statements/do...while", "do-while")}}, {{jsxref("Statements/for...in", "for-in")}}, {{jsxref("Statements/for...of", "for-of")}}, {{jsxref("Statements/try...catch", "try-catch")}}, {{jsxref("Statements/let", "let")}}, {{jsxref("Statements/var", "var")}}, {{jsxref("Statements/const", "const")}}, {{jsxref("Statements/if...else", "if-else")}}, {{jsxref("Statements/switch", "switch")}}, és más JavaScript állítások és kulcsszavak.
+
Függvények
+
Ismerje meg a JavaScript függvényeivel történő munkát alkalmazásfejlesztés során.
+
+ +

Eszközök és források

+ +

Hasznos eszközök JavaScript kód írásához és hibakereséséhez.

+ +
+
Firefox Fejlesztői Eszközök
+
Jegyzettömb, Web Konzol, JavaScript Profiler, hibakereső, és mások.
+
JavaScript Héjak
+
A JavaScript héjak lehetővé teszik JavaScript kódrészletek gyors tesztelését.
+
TogetherJS
+
Együttműkösdés egyszerűen. Ha hozzáadja a TogetherJS-t az oldalához, a felhasználók valós időben segíthetnek egymásnak az oldalon.
+
Stack Overflow
+
Stack Overflow kérdések "JavaScript" címkével.
+
JavaScript verziók és kiadási megjegyzések
+
Böngéssze a JavaScript's funkciótörténetét és végrehajtási státuszát.
+
JSFiddle
+
Szerkesszen JavaScript-et, CSS-t, HTML-t és kapjon élő eredményeket. Használjon külső forrásokat és működjön együtt a csapatával online.
+
+
+
diff --git a/files/hu/web/javascript/reference/errors/bad_return_or_yield/index.html b/files/hu/web/javascript/reference/errors/bad_return_or_yield/index.html new file mode 100644 index 0000000000..2892367f9a --- /dev/null +++ b/files/hu/web/javascript/reference/errors/bad_return_or_yield/index.html @@ -0,0 +1,54 @@ +--- +title: 'Hibaleírás: SyntaxError: return not in function' +slug: Web/JavaScript/Reference/Errors/Bad_return_or_yield +tags: + - Error +translation_of: Web/JavaScript/Reference/Errors/Bad_return_or_yield +--- +
{{jsSidebar("Errors")}}
+ +

Üzenet

+ +
SyntaxError: 'return' statement outside of function (Edge)
+SyntaxError: return not in function (Firefox)
+SyntaxError: yield not in function (Firefox)
+
+ +

Hiba típusa

+ +

{{jsxref("SyntaxError")}}.

+ +

Mi történt?

+ +

Egy  return vagy yield utasítás szerepel function-ön kívül. Lehet, hogy egy kapcsos zárójel hiányzik? A return és yield utasításoknak függvényen belül kell szerepelniük, mert csak itt értelmezhetőek. (Megszakítják illetve megállítják-folytatják a proramrész futását, és opcionálisan értékrt adnak vissza.)

+ +

Példák

+ +
var cheer = function(score) {
+  if (score === 147)
+    return 'Maximum!';
+  };
+  if (score > 100) {
+    return 'Century!';
+  }
+}
+
+// SyntaxError: return not in function
+ +

A kapcsos zárójelek első ránézésre jól vannak rendezve, de a kódrészletből hiányzik egy { az első if utasítás után. A helyes kód így nézne ki:

+ +
var cheer = function(score) {
+  if (score === 147) {
+    return 'Maximum!';
+  }
+  if (score > 100) {
+    return 'Century!';
+  }
+};
+ +

Lásd még

+ + diff --git a/files/hu/web/javascript/reference/errors/index.html b/files/hu/web/javascript/reference/errors/index.html new file mode 100644 index 0000000000..c295fccea6 --- /dev/null +++ b/files/hu/web/javascript/reference/errors/index.html @@ -0,0 +1,31 @@ +--- +title: JavaScript error reference +slug: Web/JavaScript/Reference/Errors +tags: + - Debugging + - Error + - Errors + - Exception + - JavaScript + - NeedsTranslation + - TopicStub + - exceptions +translation_of: Web/JavaScript/Reference/Errors +--- +

{{jsSidebar("Errors")}}

+ +

Below, you'll find a list of errors which are thrown by JavaScript. These errors can be a helpful debugging aid, but the reported problem isn't always immediately clear. The pages below will provide additional details about these errors. Each error is an object based upon the {{jsxref("Error")}} object, and has a name and a message.

+ +

Errors displayed in the Web console may include a link to the corresponding page below to help you quickly comprehend the problem in your code.

+ +

List of errors

+ +

In this list, each page is listed by name (the type of error) and message (a more detailed human-readable error message). Together, these two properties provide a starting point toward understanding and resolving the error. For more information, follow the links below!

+ +

{{ListSubPages("/en-US/docs/Web/JavaScript/Reference/Errors")}}

+ +

See also

+ + diff --git a/files/hu/web/javascript/reference/errors/stmt_after_return/index.html b/files/hu/web/javascript/reference/errors/stmt_after_return/index.html new file mode 100644 index 0000000000..038658955c --- /dev/null +++ b/files/hu/web/javascript/reference/errors/stmt_after_return/index.html @@ -0,0 +1,67 @@ +--- +title: 'Hibaleírás: Warning: unreachable code after return statement' +slug: Web/JavaScript/Reference/Errors/Stmt_after_return +translation_of: Web/JavaScript/Reference/Errors/Stmt_after_return +--- +
{{jsSidebar("Errors")}}
+ +

Üzenet

+ +
Warning: unreachable code after return statement (Firefox)
+
+ +

Hiba típusa

+ +

Figyelmeztetés

+ +

Mi történt?

+ +

A return utasítás befejezi a függvény végrehajtását, és opcionálisan értéket ad vissza. Ha return szerepel a függvényben közvetlenül (tehát nem if-be ágyazva), akkor a return mindig végrehajtódik. Ez esetben, ha a return után van még valamilyen kód, az soha nem fog végrehajtódni. Ezt jelzi a figyelmeztetés.

+ +

Ha a return után nincs pontosvessző, majd a következő sorban egy kifejezés (szám, string, ...) szerepel, a figyelmezetés akkor is megjelenik. A JavaScript ugyanis bizonyos esetekben az entert is pontosvesszőnek értelmezi, így a return utasítás lefut, a mögötte található kifejezés pedig nem lesz értelmezve.

+ +

Nem jelenik meg figyelmeztetés a pontosvessző nélküli returnre, ha az alábbi utasítások valamelyike követi:

+ +
    +
  • {{jsxref("Statements/throw", "throw")}}
  • +
  • {{jsxref("Statements/break", "break")}}
  • +
  • {{jsxref("Statements/var", "var")}}
  • +
  • {{jsxref("Statements/function", "function")}}
  • +
+ +

Példák

+ +

Hibás használatok

+ +
function f() {
+  var x = 3;
+  x += 4;
+  return x;   // a return azonnal visszatér a függvényből
+  x -= 3;     // tehát ez a sor soha nem fog lefutni; nem elérhető
+}
+
+function f() {
+  return     // ez 'return'-ként értelmeződik
+    3 + 4;   // tehát a funkció visszatér és ezt a sort soha nem éri el
+}
+
+ +

Helyes használat

+ +
function f() {
+  var x = 3;
+  x += 4;
+  x -= 3;
+  return x;  // OK: visszatér minden más utasítás után
+}
+
+function f() {
+  return 3 + 4  // OK: pontosvessző nélküli return, kifejezéssel ugyanazon sorban
+}
+
+ +

Lásd még

+ +
    +
  • {{jsxref("Statements/return", "Automatic Semicolon Insertion", "#Automatic_Semicolon_Insertion", 1)}}
  • +
diff --git a/files/hu/web/javascript/reference/errors/unexpected_token/index.html b/files/hu/web/javascript/reference/errors/unexpected_token/index.html new file mode 100644 index 0000000000..6e6640b551 --- /dev/null +++ b/files/hu/web/javascript/reference/errors/unexpected_token/index.html @@ -0,0 +1,46 @@ +--- +title: 'SyntaxError: Unexpected token' +slug: Web/JavaScript/Reference/Errors/Unexpected_token +translation_of: Web/JavaScript/Reference/Errors/Unexpected_token +--- +
{{jsSidebar("Errors")}}
+ +

Üzenet

+ +
SyntaxError: expected expression, got "x"
+SyntaxError: expected property name, got "x"
+SyntaxError: expected target, got "x"
+SyntaxError: expected rest argument name, got "x"
+SyntaxError: expected closing parenthesis, got "x"
+SyntaxError: expected '=>' after argument list, got "x"
+
+ +

Hiba Típusa

+ +

{{jsxref("SyntaxError")}}

+ +

Mi nem jó?

+ +

A nyelv specifikációja várna egy bizonyos nyelvi formát, de az nem teljesül. Valószínűleg ez egy egyszerű elírás.

+ +

Példák

+ +

Várható kifejezések

+ +

Például, ha egy függvény egy lezáró vesszővel hívünk meg, ez nem helyes. Ugyanis a JavaScript egy argumentumot vár ilyenkor, ami bármilyen bárilyen kifejezés is lehet.

+ +
Math.max(2, 42,);
+// SyntaxError: expected expression, got ')'
+
+ +

Correct would be omitting the comma or adding another argument:

+ +
Math.max(2, 42);
+Math.max(2, 42, 13 + 37);
+
+ +

Lásd még

+ +
    +
  • {{jsxref("Math.max()")}}
  • +
diff --git "a/files/hu/web/javascript/reference/errors/\303\251rv\303\251nytelen_t\303\255pus/index.html" "b/files/hu/web/javascript/reference/errors/\303\251rv\303\251nytelen_t\303\255pus/index.html" new file mode 100644 index 0000000000..1fd4e782de --- /dev/null +++ "b/files/hu/web/javascript/reference/errors/\303\251rv\303\251nytelen_t\303\255pus/index.html" @@ -0,0 +1,70 @@ +--- +title: 'Típushiba: "x" (nem) "y"' +slug: Web/JavaScript/Reference/Errors/Érvénytelen_típus +translation_of: Web/JavaScript/Reference/Errors/Unexpected_type +--- +
{{jsSidebar("Errors")}}
+ +
Az „x (nem) y” JavaScript-kivétel akkor keletkezik, ha egy váratlan típus fordul elő. Ez leginkább váratlan {{jsxref("undefined")}} vagy {{jsxref("null")}} értéket jelent.
+ +

Üzenet

+ +
TypeError: Unable to get property {x} of undefined or null reference (Edge)
+TypeError: "x" is (not) "y" (Firefox)
+
+Példák:
+TypeError: "x" is undefined
+TypeError: "x" is null
+TypeError: "undefined" is not an object
+TypeError: "x" is not an object or null
+TypeError: "x" is not a symbol
+
+ +

Hiba típusa

+ +

{{jsxref("TypeError")}}.

+ +

Mi történt?

+ +

Váratlan típus fordult elő a végrehajtás során. Ez leginkább {{jsxref("undefined")}} vagy {{jsxref("null")}} értékek esetén történik.

+ +

Ugyanígy bizonyos metódusok – mint például az {{jsxref("Object.create()")}} vagy a {{jsxref("Symbol.keyFor()")}} – paraméterként egy meghatározott típust várnak.

+ +

Példák

+ +

Hibás használatok

+ +
// nem definiált és null értékű paraméterek használata, amiknek esetén a substring metódus nem működik
+var foo = undefined;
+foo.substring(1); // TypeError: foo nincs definiálva
+
+var foo = null;
+foo.substring(1); // TypeError: foo értéke null
+
+
+// Bizonyos metódusok meghatározott típust várnak el
+var foo = {}
+Symbol.keyFor(foo); // TypeError: foo nem szimbólum
+
+var foo = 'bar'
+Object.create(foo); // TypeError: "foo" nem objektum vagy null értékű
+
+ +

A hiba javítása

+ +

Az undefined értékek kiszűrésére például a typeof operátort lehet használni.

+ +
if (foo !== undefined) {
+  // Most, hogy tudjuk foo definiálva van, léphetünk tovább.
+}
+if (typeof foo !== 'undefined') {
+  // Ugyanaz a jó ötlet, de nem használandó implementáció – problémákat tud okozni
+  // a ténylegesen definiálatlan és a deklarálatlan változók közötti kavarodás miatt.
+}
+ +

Lásd még

+ +
    +
  • {{jsxref("undefined")}}
  • +
  • {{jsxref("null")}}
  • +
diff --git a/files/hu/web/javascript/reference/global_objects/array/index.html b/files/hu/web/javascript/reference/global_objects/array/index.html new file mode 100644 index 0000000000..2feb1828f9 --- /dev/null +++ b/files/hu/web/javascript/reference/global_objects/array/index.html @@ -0,0 +1,538 @@ +--- +title: Array +slug: Web/JavaScript/Reference/Global_Objects/Array +tags: + - Array + - Example + - Global Objects + - JavaScript + - NeedsTranslation + - Reference + - TopicStub +translation_of: Web/JavaScript/Reference/Global_Objects/Array +--- +
{{JSRef}}
+ +

Tömbök, amelyek magas-szintű lista jellegű objektumok, létrehozásához használatos a JavaScript Array objektum.

+ +

Leírás

+ +

A tömbök listaszerű objektumok amelyek prototípusa olyan metódusokat tartalmaz  amelyekkel bejárhatóak és mutálhatóak. A JavaScipt tömbnek sem a hossza, sem az elemeinek típusa sem fix. A tömbön belül az adatok nem folytonos módon tárolhatóak, így mivel a tömb hossza bármikor megváltozhat a Javascript tömbök sürűsége nem garantált, ez a programozó által választott felhasználási módtól függ. Általánosságban ezek kényelmes tulajdonságok de ha ezek a jellemzők nem kívánatosak az ön számára érdemes lehet inkább típusos tömböket használni. A tömbök nem használhatnak stringeket elem indexként (mint egy asszociatív tömbben) csak kötelezően integereket. Ha a zárójel jelölés (vagy pont jelölés) segítségével nem-integert állítunk be vagy férünk hozzá akkor nem a tömb elemét fogjuk megkapni hanem a tömb objektum tulajdonság kollekciójának változóját. A tömb elemeinek listája és a tömb objektum tulajdonságai különböznek és a tömb bejáró és mutáló operátorait nem használhatjuk ezekhez az elnevezett tulajdonságokhoz.

+ +

Gyakori műveletek

+ +

Array létrehozása

+ +
var fruits = ["Apple", "Banana"];
+
+console.log(fruits.length);
+// 2
+
+ +

Egy Array elem elérése (indexelése)

+ +
var first = fruits[0];
+// Apple
+
+var last = fruits[fruits.length - 1];
+// Banana
+
+ +

Array bejárása

+ +
fruits.forEach(function (item, index, array) {
+  console.log(item, index);
+});
+// Apple 0
+// Banana 1
+
+ +

Hozzáadás egy Array végéhez

+ +
var newLength = fruits.push("Orange");
+// ["Apple", "Banana", "Orange"]
+
+ +

Array végéről elem eltávolítása

+ +
var last = fruits.pop(); // Orange eltávolítása (a végéről)
+// ["Apple", "Banana"];
+
+ +

Array elejéről elem eltávolítása

+ +
var first = fruits.shift(); // eltávolítja az Apple elemet az elejéről
+// ["Banana"];
+
+ +

Array elejéhez hozzáadás

+ +
var newLength = fruits.unshift("Strawberry") // hozzáadás az elejéhez
+// ["Strawberry", "Banana"];
+
+ +

Array elem indexének megkeresése

+ +
fruits.push("Mango");
+// ["Strawberry", "Banana", "Mango"]
+
+var pos = fruits.indexOf("Banana");
+// 1
+
+ +

Index pozició alapján elem eltávolítása

+ +
var removedItem = fruits.splice(pos, 1); // így távolítunk el egy elemet
+
+// ["Strawberry", "Mango"]
+ +

Index pozició alapján elemek eltávolítása

+ +
let vegetables = ['Cabbage', 'Turnip', 'Radish', 'Carrot']
+console.log(vegetables)
+// ["Cabbage", "Turnip", "Radish", "Carrot"]
+
+let pos = 1
+let n = 2
+
+let removedItems = vegetables.splice(pos, n)
+// this is how to remove items, n defines the number of items to be removed,
+// from that position(pos) onward to the end of array.
+
+console.log(vegetables)
+// ["Cabbage", "Carrot"] (the original array is changed)
+
+console.log(removedItems)
+// ["Turnip", "Radish"]
+ +

Array másolása

+ +
var shallowCopy = fruits.slice(); // this is how to make a copy
+// ["Strawberry"]
+
+ +

Syntax

+ +
[element0, element1, ..., elementN]
+new Array(element0, element1[, ...[, elementN]])
+new Array(arrayLength)
+ +

Parameters

+ +
+
elementN
+
A JavaScript array is initialized with the given elements, except in the case where a single argument is passed to the Array constructor and that argument is a number (see the arrayLength parameter below). Note that this special case only applies to JavaScript arrays created with the Array constructor, not array literals created with the bracket syntax.
+
arrayLength
+
If the only argument passed to the Array constructor is an integer between 0 and 232-1 (inclusive), this returns a new JavaScript array with length set to that number. If the argument is any other number, a {{jsxref("RangeError")}} exception is thrown.
+
+ +

Description

+ +

Arrays are list-like objects whose prototype has methods to perform traversal and mutation operations. Neither the length of a JavaScript array nor the types of its elements are fixed. Since an array's length can change at any time, and data can be stored at non-contiguous locations in the array, JavaScript arrays are not guaranteed to be dense; this depends on how the programmer chooses to use them. In general, these are convenient characteristics; but if these features are not desirable for your particular use, you might consider using typed arrays.

+ +

Some people think that you shouldn't use an array as an associative array. In any case, you can use plain {{jsxref("Global_Objects/Object", "objects")}} instead, although doing so comes with its own caveats. See the post Lightweight JavaScript dictionaries with arbitrary keys as an example.

+ +

Accessing array elements

+ +

JavaScript arrays are zero-indexed: the first element of an array is at index 0, and the last element is at the index equal to the value of the array's {{jsxref("Array.length", "length")}} property minus 1.

+ +
var arr = ['this is the first element', 'this is the second element'];
+console.log(arr[0]);              // logs 'this is the first element'
+console.log(arr[1]);              // logs 'this is the second element'
+console.log(arr[arr.length - 1]); // logs 'this is the second element'
+
+ +

Array elements are object properties in the same way that toString is a property, but trying to access an element of an array as follows throws a syntax error, because the property name is not valid:

+ +
console.log(arr.0); // a syntax error
+
+ +

There is nothing special about JavaScript arrays and the properties that cause this. JavaScript properties that begin with a digit cannot be referenced with dot notation; and must be accessed using bracket notation. For example, if you had an object with a property named '3d', it can only be referenced using bracket notation. E.g.:

+ +
var years = [1950, 1960, 1970, 1980, 1990, 2000, 2010];
+console.log(years.0);   // a syntax error
+console.log(years[0]);  // works properly
+
+ +
renderer.3d.setTexture(model, 'character.png');     // a syntax error
+renderer['3d'].setTexture(model, 'character.png');  // works properly
+
+ +

Note that in the 3d example, '3d' had to be quoted. It's possible to quote the JavaScript array indexes as well (e.g., years['2'] instead of years[2]), although it's not necessary. The 2 in years[2] is coerced into a string by the JavaScript engine through an implicit toString conversion. It is for this reason that '2' and '02' would refer to two different slots on the years object and the following example could be true:

+ +
console.log(years['2'] != years['02']);
+
+ +

Similarly, object properties which happen to be reserved words(!) can only be accessed as string literals in bracket notation(but it can be accessed by dot notation in firefox 40.0a2 at least):

+ +
var promise = {
+  'var'  : 'text',
+  'array': [1, 2, 3, 4]
+};
+
+console.log(promise['array']);
+
+ +

Relationship between length and numerical properties

+ +

A JavaScript array's {{jsxref("Array.length", "length")}} property and numerical properties are connected. Several of the built-in array methods (e.g., {{jsxref("Array.join", "join")}}, {{jsxref("Array.slice", "slice")}}, {{jsxref("Array.indexOf", "indexOf")}}, etc.) take into account the value of an array's {{jsxref("Array.length", "length")}} property when they're called. Other methods (e.g., {{jsxref("Array.push", "push")}}, {{jsxref("Array.splice", "splice")}}, etc.) also result in updates to an array's {{jsxref("Array.length", "length")}} property.

+ +
var fruits = [];
+fruits.push('banana', 'apple', 'peach');
+
+console.log(fruits.length); // 3
+
+ +

When setting a property on a JavaScript array when the property is a valid array index and that index is outside the current bounds of the array, the engine will update the array's {{jsxref("Array.length", "length")}} property accordingly:

+ +
fruits[5] = 'mango';
+console.log(fruits[5]); // 'mango'
+console.log(Object.keys(fruits));  // ['0', '1', '2', '5']
+console.log(fruits.length); // 6
+
+ +

Increasing the {{jsxref("Array.length", "length")}}.

+ +
fruits.length = 10;
+console.log(Object.keys(fruits)); // ['0', '1', '2', '5']
+console.log(fruits.length); // 10
+
+ +

Decreasing the {{jsxref("Array.length", "length")}} property does, however, delete elements.

+ +
fruits.length = 2;
+console.log(Object.keys(fruits)); // ['0', '1']
+console.log(fruits.length); // 2
+
+ +

This is explained further on the {{jsxref("Array.length")}} page.

+ +

Creating an array using the result of a match

+ +

The result of a match between a regular expression and a string can create a JavaScript array. This array has properties and elements which provide information about the match. Such an array is returned by {{jsxref("RegExp.exec")}}, {{jsxref("String.match")}}, and {{jsxref("String.replace")}}. To help explain these properties and elements, look at the following example and then refer to the table below:

+ +
// Match one d followed by one or more b's followed by one d
+// Remember matched b's and the following d
+// Ignore case
+
+var myRe = /d(b+)(d)/i;
+var myArray = myRe.exec('cdbBdbsbz');
+
+ +

The properties and elements returned from this match are as follows:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property/ElementDescriptionExample
inputA read-only property that reflects the original string against which the regular expression was matched.cdbBdbsbz
indexA read-only property that is the zero-based index of the match in the string.1
[0]A read-only element that specifies the last matched characters.dbBd
[1], ...[n]Read-only elements that specify the parenthesized substring matches, if included in the regular expression. The number of possible parenthesized substrings is unlimited.[1]: bB
+ [2]: d
+ +

Properties

+ +
+
Array.length
+
The Array constructor's length property whose value is 1.
+
{{jsxref("Array.@@species", "get Array[@@species]")}}
+
The constructor function that is used to create derived objects.
+
{{jsxref("Array.prototype")}}
+
Allows the addition of properties to all array objects.
+
+ +

Methods

+ +
+
{{jsxref("Array.from()")}}
+
Creates a new Array instance from an array-like or iterable object.
+
{{jsxref("Array.isArray()")}}
+
Returns true if a variable is an array, if not false.
+
{{jsxref("Array.of()")}}
+
Creates a new Array instance with a variable number of arguments, regardless of number or type of the arguments.
+
+ +

Array instances

+ +

All Array instances inherit from {{jsxref("Array.prototype")}}. The prototype object of the Array constructor can be modified to affect all Array instances.

+ +

Properties

+ +
{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype', 'Properties')}}
+ +

Methods

+ +

Mutator methods

+ +
{{page('en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype', 'Mutator_methods')}}
+ +

Accessor methods

+ +
{{page('en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype', 'Accessor_methods')}}
+ +

Iteration methods

+ +
{{page('en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype', 'Iteration_methods')}}
+ +

Array generic methods

+ +
+

Array generics are non-standard, deprecated and will get removed in the near future. Note that you can not rely on them cross-browser. However, there is a shim available on GitHub.

+
+ +

Sometimes you would like to apply array methods to strings or other array-like objects (such as function {{jsxref("Functions/arguments", "arguments", "", 1)}}). By doing this, you treat a string as an array of characters (or otherwise treat a non-array as an array). For example, in order to check that every character in the variable str is a letter, you would write:

+ +
function isLetter(character) {
+  return character >= 'a' && character <= 'z';
+}
+
+if (Array.prototype.every.call(str, isLetter)) {
+  console.log("The string '" + str + "' contains only letters!");
+}
+
+ +

This notation is rather wasteful and JavaScript 1.6 introduced a generic shorthand:

+ +
if (Array.every(str, isLetter)) {
+  console.log("The string '" + str + "' contains only letters!");
+}
+
+ +

{{jsxref("Global_Objects/String", "Generics", "#String_generic_methods", 1)}} are also available on {{jsxref("String")}}.

+ +

These are not part of ECMAScript standards (though the ES2015 {{jsxref("Array.from()")}} can be used to achieve this). The following is a shim to allow its use in all browsers:

+ +
// Assumes Array extras already present (one may use polyfills for these as well)
+(function() {
+  'use strict';
+
+  var i,
+    // We could also build the array of methods with the following, but the
+    //   getOwnPropertyNames() method is non-shimable:
+    // Object.getOwnPropertyNames(Array).filter(function(methodName) {
+    //   return typeof Array[methodName] === 'function'
+    // });
+    methods = [
+      'join', 'reverse', 'sort', 'push', 'pop', 'shift', 'unshift',
+      'splice', 'concat', 'slice', 'indexOf', 'lastIndexOf',
+      'forEach', 'map', 'reduce', 'reduceRight', 'filter',
+      'some', 'every', 'find', 'findIndex', 'entries', 'keys',
+      'values', 'copyWithin', 'includes'
+    ],
+    methodCount = methods.length,
+    assignArrayGeneric = function(methodName) {
+      if (!Array[methodName]) {
+        var method = Array.prototype[methodName];
+        if (typeof method === 'function') {
+          Array[methodName] = function() {
+            return method.call.apply(method, arguments);
+          };
+        }
+      }
+    };
+
+  for (i = 0; i < methodCount; i++) {
+    assignArrayGeneric(methods[i]);
+  }
+}());
+
+ +

Examples

+ +

Creating an array

+ +

The following example creates an array, msgArray, with a length of 0, then assigns values to msgArray[0] and msgArray[99], changing the length of the array to 100.

+ +
var msgArray = [];
+msgArray[0] = 'Hello';
+msgArray[99] = 'world';
+
+if (msgArray.length === 100) {
+  console.log('The length is 100.');
+}
+
+ +

Creating a two-dimensional array

+ +

The following creates a chess board as a two dimensional array of strings. The first move is made by copying the 'p' in (6,4) to (4,4). The old position (6,4) is made blank.

+ +
var board = [
+  ['R','N','B','Q','K','B','N','R'],
+  ['P','P','P','P','P','P','P','P'],
+  [' ',' ',' ',' ',' ',' ',' ',' '],
+  [' ',' ',' ',' ',' ',' ',' ',' '],
+  [' ',' ',' ',' ',' ',' ',' ',' '],
+  [' ',' ',' ',' ',' ',' ',' ',' '],
+  ['p','p','p','p','p','p','p','p'],
+  ['r','n','b','q','k','b','n','r'] ];
+
+console.log(board.join('\n') + '\n\n');
+
+// Move King's Pawn forward 2
+board[4][4] = board[6][4];
+board[6][4] = ' ';
+console.log(board.join('\n'));
+
+ +

Here is the output:

+ +
R,N,B,Q,K,B,N,R
+P,P,P,P,P,P,P,P
+ , , , , , , ,
+ , , , , , , ,
+ , , , , , , ,
+ , , , , , , ,
+p,p,p,p,p,p,p,p
+r,n,b,q,k,b,n,r
+
+R,N,B,Q,K,B,N,R
+P,P,P,P,P,P,P,P
+ , , , , , , ,
+ , , , , , , ,
+ , , , ,p, , ,
+ , , , , , , ,
+p,p,p,p, ,p,p,p
+r,n,b,q,k,b,n,r
+
+ +

Using an array to tabulate a set of values

+ +
values=[];
+for (x=0; x<10; x++){
+ values.push([
+  2**x,
+  2*x**2
+ ])
+};
+console.table(values)
+ +

Results in

+ +
0	1	0
+1	2	2
+2	4	8
+3	8	18
+4	16	32
+5	32	50
+6	64	72
+7	128	98
+8	256	128
+9	512	162
+ +

(First column is the (index))

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('ES1')}}{{Spec2('ES1')}}Initial definition.
{{SpecName('ES5.1', '#sec-15.4', 'Array')}}{{Spec2('ES5.1')}}New methods added: {{jsxref("Array.isArray")}}, {{jsxref("Array.prototype.indexOf", "indexOf")}}, {{jsxref("Array.prototype.lastIndexOf", "lastIndexOf")}}, {{jsxref("Array.prototype.every", "every")}}, {{jsxref("Array.prototype.some", "some")}}, {{jsxref("Array.prototype.forEach", "forEach")}}, {{jsxref("Array.prototype.map", "map")}}, {{jsxref("Array.prototype.filter", "filter")}}, {{jsxref("Array.prototype.reduce", "reduce")}}, {{jsxref("Array.prototype.reduceRight", "reduceRight")}}
{{SpecName('ES6', '#sec-array-objects', 'Array')}}{{Spec2('ES6')}}New methods added: {{jsxref("Array.from")}}, {{jsxref("Array.of")}}, {{jsxref("Array.prototype.find", "find")}}, {{jsxref("Array.prototype.findIndex", "findIndex")}}, {{jsxref("Array.prototype.fill", "fill")}}, {{jsxref("Array.prototype.copyWithin", "copyWithin")}}
{{SpecName('ESDraft', '#sec-array-objects', 'Array')}}{{Spec2('ESDraft')}}New method added: {{jsxref("Array.prototype.includes()")}}
+ +

Browser compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + diff --git a/files/hu/web/javascript/reference/global_objects/array/keys/index.html b/files/hu/web/javascript/reference/global_objects/array/keys/index.html new file mode 100644 index 0000000000..2f7c0cebef --- /dev/null +++ b/files/hu/web/javascript/reference/global_objects/array/keys/index.html @@ -0,0 +1,77 @@ +--- +title: Array.prototype.keys() +slug: Web/JavaScript/Reference/Global_Objects/Array/keys +tags: + - ECMAScript 2015 + - Iterator + - JavaScript + - Prototype + - kulcs + - metódus + - tömb +translation_of: Web/JavaScript/Reference/Global_Objects/Array/keys +--- +
{{JSRef}}
+ +

A keys() metódus egy új Array Iterator objektummal tér vissza, amely a tömb indexeihez tartozó kulcsokat tartalmazza.

+ +
{{EmbedInteractiveExample("pages/js/array-keys.html")}}
+ + + +

Szintaxis

+ +
arr.keys()
+ +

Visszatérési érték

+ +

Egy új {{jsxref("Array")}} iterátor objektum.

+ +

Példák

+ +

A kulcs iterátor nem hagyja figyelmen kívül az üres helyeket

+ +
var arr = ['a', , 'c'];
+var sparseKeys = Object.keys(arr);
+var denseKeys = [...arr.keys()];
+console.log(sparseKeys); // ['0', '2']
+console.log(denseKeys);  // [0, 1, 2]
+
+ +

Specifikációk

+ + + + + + + + + + + + + + + + + + + +
SpecifikációStátuszMegjegyzés
{{SpecName('ES2015', '#sec-array.prototype.keys', 'Array.prototype.keys')}}{{Spec2('ES2015')}}Kezdeti definíció.
{{SpecName('ESDraft', '#sec-array.prototype.keys', 'Array.prototype.keys')}}{{Spec2('ESDraft')}} 
+ +

Böngésző kompatibilitás

+ +
+ + +

{{Compat("javascript.builtins.Array.keys")}}

+
+ +

Lásd még

+ + diff --git a/files/hu/web/javascript/reference/global_objects/array/of/index.html b/files/hu/web/javascript/reference/global_objects/array/of/index.html new file mode 100644 index 0000000000..ff3af4288a --- /dev/null +++ b/files/hu/web/javascript/reference/global_objects/array/of/index.html @@ -0,0 +1,94 @@ +--- +title: Array.of() +slug: Web/JavaScript/Reference/Global_Objects/Array/of +tags: + - tömb +translation_of: Web/JavaScript/Reference/Global_Objects/Array/of +--- +
{{JSRef}}
+ +

Az Array.of() metódus egy új Array példányt hoz létre változó számú argumentumokból, azok számától és típusától függetlenül.

+ +

Az Array.of() és az Array konstruktor működése között az a különbség, hogy máshogy hasznája az argumentumként megadott egész számokat: az Array.of(7) létrehoz egy új tömböt, melynek az egyetlen eleme a 7, ezzel szemben az Array(7) egy olyan üres tömböt hoz létre, melynek a length property-je: 7 (Megjegyzés: ez valójában egy 7 üres elemű (empty) tömböt jelent, nem olyat, melynek az elemei ténylegesen undefined értékeket tartalmaznának).

+ +
Array.of(7);       // [7]
+Array.of(1, 2, 3); // [1, 2, 3]
+
+Array(7);          // 7 üres elemű tömb: [empty × 7]
+Array(1, 2, 3);    // [1, 2, 3]
+
+ +

Szintakszis

+ +
Array.of(elem0[, elem1[, ...[, elemN]]])
+ +

Paraméterek

+ +
+
elemN
+
Elemek, melyeket a tömb tartalmazni fog
+
+ +

Visszatérési érték

+ +

Egy új {{jsxref("Array")}} példány.

+ +

Leírás

+ +

Ez a függvény szabványos az ECMAScript 2015 óta. További részletekért lásd az Array.of és az Array.from proposal-t és a Array.of polyfill-t.

+ +

Példák

+ +
Array.of(1);         // [1]
+Array.of(1, 2, 3);   // [1, 2, 3]
+Array.of(undefined); // [undefined]
+
+ +

Polyfill

+ +

A következő kód lefuttatása után az Array.of() hasznáható lesz, amennyiben a kliens ezt natíven nem támogatja.

+ +
if (!Array.of) {
+  Array.of = function() {
+    return Array.prototype.slice.call(arguments);
+  };
+}
+
+ +

Specifikációk

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('ES2015', '#sec-array.of', 'Array.of')}}{{Spec2('ES2015')}}Kezdeti definíció.
{{SpecName('ESDraft', '#sec-array.of', 'Array.of')}}{{Spec2('ESDraft')}}
+ +

Böngésző kompatibilitás

+ +
+ + +

{{Compat("javascript.builtins.Array.of")}}

+
+ +

Lásd még:

+ +
    +
  • {{jsxref("Array")}}
  • +
  • {{jsxref("Array.from()")}}
  • +
  • {{jsxref("TypedArray.of()")}}
  • +
diff --git a/files/hu/web/javascript/reference/global_objects/array/sort/index.html b/files/hu/web/javascript/reference/global_objects/array/sort/index.html new file mode 100644 index 0000000000..408507ddd8 --- /dev/null +++ b/files/hu/web/javascript/reference/global_objects/array/sort/index.html @@ -0,0 +1,294 @@ +--- +title: Array.prototype.sort() +slug: Web/JavaScript/Reference/Global_Objects/Array/sort +tags: + - Prototípus + - Rendezés + - metódus + - tömb +translation_of: Web/JavaScript/Reference/Global_Objects/Array/sort +--- +
{{JSRef}}
+ +

sort() eljárás  egy tömb elemeit rendezi helyben, és visszaadja a tömböt. Egy rendezés nem teljesen stabil. Az alapértelmezett rendezési sorrend függ a sztring Unicode táblában való elhelyezkedésétől.

+ +
var fruits = ['cherries', 'apples', 'banana'];
+fruits.sort(); // ['apple', 'banana', 'cherries']
+
+var scores = [1, 10, 21, 2];
+scores.sort(); // [1, 10, 2, 21]
+// Figyeld meg,hogy a 10 a 2 előtt jön,
+// mivel a '10' hamarabb van,mint '2' a Unicode sorolás szerint.
+
+var things = ['word', 'Word', '1 Word', '2 Words'];
+things.sort(); // ['1 Word', '2 Words', 'Word', 'word']
+// A Unicode-ban, a számok hamarabb kerülnek sorra mint a nagybetűk,
+// de, azok hamarabb vannak,mint a kisbetűk.
+
+ +

Szintaxis

+ +
arr.sort() arr.sort(compareFunction)
+
+ +

Paraméterek

+ +
+
compareFunction {{optional_inline}}
+
Meghatároz egy függvényt, amely definiálja  a rendezési sorrendet. Ha elhagyjuk, a tömb rendezése az egyes betűk Unicode táblában való elhelyezkedése alapján történik meg.
+
+ +

Visszatérési érték

+ +

A rendezett tömb. Vegyük figyelembe, hogy a rendezés helyben történt és nem készült másolat a tömbről.

+ +

Leírás

+ +

Ha a compareFunction nem mellékelt, akkor az elemek rendezése úgy zajlik, hogy először átkonvertálja sztringgé, majd összehasonlítja a Unicode karakter sorrendet. Például, "Banana" hamarabb lesz,mint "cherry". Szám-sorrendben a 9 hamarabb lesz 80-nál, de mivel a számok átkonvertálódnak sztringgé, "80" hamarabb lesz "9"-nél a Unicode sorolás szerint.

+ +

Ha compareFunction mellékelt, a tömb elemei rendezésre kerülnek az összehasonlító függvény visszatérési értéke alapján. Ha a és b elemek összehasonlításra kerülnek:

+ +
    +
  • Ha compareFunction(a, b) kisebb mint 0, akkor a kisebb indexet kap,mint b, szóval a előre kerül.
  • +
  • Ha compareFunction(a, b) 0-t ad vissza, akkor a-t és b-t  hagyjuk változatlanul,de a többi elemet rendezzük. Megjegyzés: az ECMAscript szabvány nem garantálja ezt a viselkedést,és hogy nem minden böngésző (például: Mozilla verziók,melyek 2003 körüliek) támogatja.
  • +
  • Ha compareFunction(a, b) nagyobb mint 0, rendezze b-t kisebb indexre mint a.
  • +
  • compareFunction(a, b) mindig ugyanazt az értéket kellene visszaadja, amikor a jellemző a-b párost kapja meg paraméterként. Ha következetlen értéket ad vissza, akkor a rendezési sorrend "undefined".
  • +
+ +

Szóval, az összehasonlító függvény így néz ki:

+ +
function compare(a, b) {
+  if (a kisebb mint b a sorrend kritéria szerint) {
+    return -1;
+  }
+  if (a nagyobb mint b a sorrend kritéria szerint) {
+    return 1;
+  }
+  // a-nak egyenlőnek kell lennie b-vel
+  return 0;
+}
+
+ +

To compare numbers instead of strings, the compare function can simply subtract b from a. The following function will sort the array ascending (if it doesn't contain Infinity and NaN):

+ +
function compareNumbers(a, b) {
+  return a - b;
+}
+
+ +

The sort method can be conveniently used with {{jsxref("Operators/function", "function expressions", "", 1)}} (and closures):

+ +
var numbers = [4, 2, 5, 1, 3];
+numbers.sort(function(a, b) {
+  return a - b;
+});
+console.log(numbers);
+
+// [1, 2, 3, 4, 5]
+
+ +

Objektumok is rendezhetőek, ha megadjuk az egyik tulajdonságát.

+ +
var items = [
+  { name: 'Edward', value: 21 },
+  { name: 'Sharpe', value: 37 },
+  { name: 'And', value: 45 },
+  { name: 'The', value: -12 },
+  { name: 'Magnetic', value: 13 },
+  { name: 'Zeros', value: 37 }
+];
+
+// sort by value
+items.sort(function (a, b) {
+  return a.value - b.value;
+});
+
+// sort by name
+items.sort(function(a, b) {
+  var nameA = a.name.toUpperCase(); // nagybetűk és kisbetűk elhagyása
+  var nameB = b.name.toUpperCase(); // nagybetűk és kisbetűk elhagyása
+  if (nameA < nameB) {
+    return -1;
+  }
+  if (nameA > nameB) {
+    return 1;
+  }
+
+  // a neveknek egyeznie kell
+  return 0;
+});
+ +

Példák

+ +

Tömbök készítése,megjelenítése és rendezése

+ +

A következő példa négy tömböt készít, megjeleníti az eredeti tömböt, majd a rendezett tömböket. A numerikus tömbök először nem,azután használva a compare függvényt rendezésre kerülnek.

+ +
var stringArray = ['Blue', 'Humpback', 'Beluga'];
+var numericStringArray = ['80', '9', '700'];
+var numberArray = [40, 1, 5, 200];
+var mixedNumericArray = ['80', '9', '700', 40, 1, 5, 200];
+
+function compareNumbers(a, b) {
+  return a - b;
+}
+
+console.log('stringArray:', stringArray.join());
+console.log('Sorted:', stringArray.sort());
+
+console.log('numberArray:', numberArray.join());
+console.log('Sorted without a compare function:', numberArray.sort());
+console.log('Sorted with compareNumbers:', numberArray.sort(compareNumbers));
+
+console.log('numericStringArray:', numericStringArray.join());
+console.log('Sorted without a compare function:', numericStringArray.sort());
+console.log('Sorted with compareNumbers:', numericStringArray.sort(compareNumbers));
+
+console.log('mixedNumericArray:', mixedNumericArray.join());
+console.log('Sorted without a compare function:', mixedNumericArray.sort());
+console.log('Sorted with compareNumbers:', mixedNumericArray.sort(compareNumbers));
+
+ +

This example produces the following output. As the output shows, when a compare function is used, numbers sort correctly whether they are numbers or numeric strings.

+ +
stringArray: Blue,Humpback,Beluga
+Sorted: Beluga,Blue,Humpback
+
+numberArray: 40,1,5,200
+Sorted without a compare function: 1,200,40,5
+Sorted with compareNumbers: 1,5,40,200
+
+numericStringArray: 80,9,700
+Sorted without a compare function: 700,80,9
+Sorted with compareNumbers: 9,80,700
+
+mixedNumericArray: 80,9,700,40,1,5,200
+Sorted without a compare function: 1,200,40,5,700,80,9
+Sorted with compareNumbers: 1,5,9,40,80,200,700
+
+ +

Nem-ASCII karakterek rendezése

+ +

For sorting strings with non-ASCII characters, i.e. strings with accented characters (e, é, è, a, ä, etc.), strings from languages other than English: use {{jsxref("String.localeCompare")}}. This function can compare those characters so they appear in the right order.

+ +
var items = ['réservé', 'premier', 'cliché', 'communiqué', 'café', 'adieu'];
+items.sort(function (a, b) {
+  return a.localeCompare(b);
+});
+
+// items is ['adieu', 'café', 'cliché', 'communiqué', 'premier', 'réservé']
+
+ +

Rendezés map-al

+ +

The compareFunction can be invoked multiple times per element within the array. Depending on the compareFunction's nature, this may yield a high overhead. The more work a compareFunction does and the more elements there are to sort, the wiser it may be to consider using a map for sorting. The idea is to walk the array once to extract the actual values used for sorting into a temporary array, sort the temporary array and then walk the temporary array to achieve the right order.

+ +
// the array to be sorted
+var list = ['Delta', 'alpha', 'CHARLIE', 'bravo'];
+
+// temporary array holds objects with position and sort-value
+var mapped = list.map(function(el, i) {
+  return { index: i, value: el.toLowerCase() };
+})
+
+// sorting the mapped array containing the reduced values
+mapped.sort(function(a, b) {
+  return +(a.value > b.value) || +(a.value === b.value) - 1;
+});
+
+// container for the resulting order
+var result = mapped.map(function(el){
+  return list[el.index];
+});
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('ES1')}}{{Spec2('ES1')}}Initial definition.
{{SpecName('ES5.1', '#sec-15.4.4.11', 'Array.prototype.sort')}}{{Spec2('ES5.1')}}
{{SpecName('ES6', '#sec-array.prototype.sort', 'Array.prototype.sort')}}{{Spec2('ES6')}}
{{SpecName('ESDraft', '#sec-array.prototype.sort', 'Array.prototype.sort')}}{{Spec2('ESDraft')}}
+ +

Böngésző kompatibilitás

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FunkcióChromeFirefox (Gecko)Internet ExplorerOperaSafari
Alap támogatás{{CompatChrome("1.0")}}{{CompatGeckoDesktop("1.7")}}{{CompatIE("5.5")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FunkcióAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Alap támogátás{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Lásd még

+ +
    +
  • {{jsxref("Array.prototype.reverse()")}}
  • +
  • {{jsxref("String.prototype.localeCompare()")}}
  • +
diff --git a/files/hu/web/javascript/reference/global_objects/error/index.html b/files/hu/web/javascript/reference/global_objects/error/index.html new file mode 100644 index 0000000000..f27374e30c --- /dev/null +++ b/files/hu/web/javascript/reference/global_objects/error/index.html @@ -0,0 +1,218 @@ +--- +title: Error +slug: Web/JavaScript/Reference/Global_Objects/Error +translation_of: Web/JavaScript/Reference/Global_Objects/Error +--- +
{{JSRef}}
+ +

Az Error objektumok futásidejű hiba során keletkeznek. Továbbá ezek az alapjai a saját készítésű hibaobjektumoknak is. Később olvashatsz a beépített hiba típusokról is.

+ +

Leírás

+ +

A futásidejű hibák során Error objektumok keletkezhetnek, illetve érkezhetnek.

+ +

Hiba típusok

+ +

A generikus Error konstruktor mellett, A JavaScript-ben más hiba konstruktorok is léteznek. A kliens-oldali kivételek listájához, lásd, a Kivételek kezelése fejezetet.

+ +
+
{{JSxRef("EvalError")}}
+
Egy olyan hibaobjektum példányát hozza létre, ami az {{JSxRef("eval", "eval()")}} globális függvénnyel kapcsolatos.
+
{{JSxRef("RangeError")}}
+
Egy olyan hibaobjektum példányát hozza létre, ami akkor történik, ha valamelyik szám típusú változó az érvényes értékkészleten kívűlre esik.
+
{{JSxRef("ReferenceError")}}
+
Egy olyan hibaobjektum példányát hozza létre, ami akkor történik, ha érvénytelen hivatkozásra történik hivatkozás.
+
{{JSxRef("SyntaxError")}}
+
Egy olyan hibaobjektum példányát hozza létre, ami egy szintaktikai hibát jelez.
+
{{JSxRef("TypeError")}}
+
Egy olyan hibaobjektum példányát hozza létre, ami akkor keletkezik, ha a változó, vagy paraméter típusa nem megfelelő, vagy érvénytelen.
+
{{JSxRef("URIError")}}
+
Egy olyan hibaobjektum példányát hozza létre, ami akkor keletkezik, ha az {{JSxRef("encodeURI", "encodeURI()")}}, vagy a {{JSxRef("decodeURI", "decodeURI()")}} függvények érvénytelen bemeneti paramétereket kapnak.
+
{{JSxRef("AggregateError")}}
+
Egy olyan hibaobjektum példányát hozza létre, ami egyszerre több hibát foglal magába. Ilyen objektum akkor jön létre, amikor egy függvényben egyidejűleg több hiba is történik. Például.: {{JSxRef("Promise.any()")}}.
+
{{JSxRef("InternalError")}} {{non-standard_inline}}
+
Egy olyan hibaobjektum példányát hozza létre, ami akkor jön létre, amikor a JavaScript motorjában belső hiba keletkezik. Pl.: "too much recursion" ("Túl sok rekurzió").
+
+ +

Konstruktor

+ +
+
Error()
+
Egy új Error objektumot hoz létre.
+
+ +

Statikus függvények

+ +
+
{{JSxRef("Error.captureStackTrace()")}}
+
Egy nem-standard V8 függvény, ami létrehoz egy {{JSxRef("Error.prototype.stack", "stack")}} tagváltozót az Error példányon.
+
+ +

Példány tagváltozói

+ +
+
{{jsxref("Error.prototype.message")}}
+
Rövid hibaüzenet.
+
{{jsxref("Error.prototype.name")}}
+
A hiba neve.
+
{{jsxref("Error.prototype.description")}}
+
Egy nem-standard Microsoft tagváltozó a hiba leírásához. Hasonlít a {{jsxref("Error.prototype.message", "message")}}-hez.
+
{{jsxref("Error.prototype.number")}}
+
Egy nem-standard Microsoft tagváltozó a hiba számához.
+
{{jsxref("Error.prototype.fileName")}}
+
Egy nem-standard Mozilla tagváltozó, ami a hibát okozó fájl útvonalát tartalmazza.
+
{{jsxref("Error.prototype.lineNumber")}}
+
Egy nem-standard Mozilla tagváltozó, ami a hibát okozó fájl azon sorát jelöli, ahonnan a hiba származik.
+
{{jsxref("Error.prototype.columnNumber")}}
+
Egy nem-standard Mozilla tagváltozó, ami a hibát tartalmazó sor azon oszlopát (karakterét) jelöli, ahonnan a hiba származik.
+
{{jsxref("Error.prototype.stack")}}
+
Egy nem-standard Mozilla tagváltozó ami a stacktrace-t tartalmazza (A hiba nyomonkövetése a veremen).
+
+ +

Példány függvények

+ +
+
{{jsxref("Error.prototype.toString()")}}
+
Egy string-gel tér vissza, ami leírja az objektumot. Ez a függvény felüldefiniálja a {{jsxref("Object.prototype.toString()")}} fügvényt.
+
+ +

Példák

+ +

Generikus hiba keletkezése

+ +

Az Error objektumot általában akkor érdemes létrehozni, ha azt utána használjuk, vagy eldobjuk a {{JSxRef("Statements/throw", "throw")}} kulcsszó segítségével. Az ilyen hibákat a {{JSxRef("Statements/try...catch", "try...catch")}} szerkezettel lehet könnyedén kezelni:

+ +
try {
+  throw new Error('Whoops!')
+} catch (e) {
+  console.error(e.name + ': ' + e.message)
+}
+
+ +

Különleges hibák kezelése

+ +

A hiba objektum {{JSxRef("Object.prototype.constructor", "constructor")}} tagváltozójával, illetve modern JavaScript motor használata esetén, a {{JSxRef("Operators/instanceof", "instanceof")}} kulcsszóval lehetséges a hiba objektum konkrét típusát is lekérdezni. Ezzel leszűkíthető a hibakezelés konkrét hibatípusokra:

+ +
try {
+  foo.bar()
+} catch (e) {
+  if (e instanceof EvalError) {
+    console.error(e.name + ': ' + e.message)
+  } else if (e instanceof RangeError) {
+    console.error(e.name + ': ' + e.message)
+  }
+  // ... etc
+}
+
+ +

Saját hiba típusok

+ +

Elképzelhető, hogy saját hibatípust szereténk készíteni, ami az Error objektumból származik. Ezáltal tudjuk használni a throw new MyError() kifejezést a hiba jelzéséhez, és az instanceof MyError -t a különleges hiba kezeléséhez. Ezzel biztosítható a szebb és konzisztensebb hibakezelés. 

+ +

A kérdéskörről olvashatsz bővebben a "What's a good way to extend Error in JavaScript?" című téma alatt a StackOverflow fórumán.

+ +

ES6 Saját Error Osztály

+ +
+

7-es, vagy régebbi Babel verziók képesek a CustomError osztályfüggvények kezelésére, de csak akkor, ha azokat at Object.defineProperty()-vel megfelelően deklarálták. Máskülönben, a Babel régebbi verziói és más fordítók nem tudják kezelni az alábbi kódrészletet hozzáadott konfiguráció nélkül.

+
+ +
+

Egyes böngészőkben előfordul a CustomError konstruktor a stacktrace-ben, ha ES2015-ös osztályokat használunk.

+
+ +
class CustomError extends Error {
+  constructor(foo = 'bar', ...params) {
+    // Pass remaining arguments (including vendor specific ones) to parent constructor
+    super(...params)
+
+    // Maintains proper stack trace for where our error was thrown (only available on V8)
+    if (Error.captureStackTrace) {
+      Error.captureStackTrace(this, CustomError)
+    }
+
+    this.name = 'CustomError'
+    // Custom debugging information
+    this.foo = foo
+    this.date = new Date()
+  }
+}
+
+try {
+  throw new CustomError('baz', 'bazMessage')
+} catch(e) {
+  console.error(e.name)    //CustomError
+  console.error(e.foo)     //baz
+  console.error(e.message) //bazMessage
+  console.error(e.stack)   //stacktrace
+}
+ +

ES5 Saját Error Objektumok

+ +
+

Minden böngészőben előfordul a CustomError konstruktor a stacktrace-ben, ha prototípus alapján deklaráljuk azt.

+
+ +
function CustomError(foo, message, fileName, lineNumber) {
+  var instance = new Error(message, fileName, lineNumber);
+  instance.name = 'CustomError';
+  instance.foo = foo;
+  Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
+  if (Error.captureStackTrace) {
+    Error.captureStackTrace(instance, CustomError);
+  }
+  return instance;
+}
+
+CustomError.prototype = Object.create(Error.prototype, {
+  constructor: {
+    value: Error,
+    enumerable: false,
+    writable: true,
+    configurable: true
+  }
+});
+
+if (Object.setPrototypeOf){
+  Object.setPrototypeOf(CustomError, Error);
+} else {
+  CustomError.__proto__ = Error;
+}
+
+try {
+  throw new CustomError('baz', 'bazMessage');
+} catch(e){
+  console.error(e.name); //CustomError
+  console.error(e.foo); //baz
+  console.error(e.message); //bazMessage
+}
+ +

Specifikációk

+ + + + + + + + + + + + +
Specification
{{SpecName('ESDraft', '#sec-error-objects', 'Error')}}
+ +

Böngészőkompatibilitás

+ +
+ + +

{{Compat("javascript.builtins.Error")}}

+
+ +

Lásd még

+ +
    +
  • {{JSxRef("Statements/throw", "throw")}}
  • +
  • {{JSxRef("Statements/try...catch", "try...catch")}}
  • +
diff --git "a/files/hu/web/javascript/reference/global_objects/f\303\274ggv\303\251ny/index.html" "b/files/hu/web/javascript/reference/global_objects/f\303\274ggv\303\251ny/index.html" new file mode 100644 index 0000000000..2e1f19b7c6 --- /dev/null +++ "b/files/hu/web/javascript/reference/global_objects/f\303\274ggv\303\251ny/index.html" @@ -0,0 +1,112 @@ +--- +title: Függvény +slug: Web/JavaScript/Reference/Global_Objects/Függvény +tags: + - Függvény + - JavaScript + - Osztály +translation_of: Web/JavaScript/Reference/Global_Objects/Function +--- +
{{JSRef}}
+ +

Minden JavaScript függvény tulajdonképpen egy Function objektum. Ez látható a következő kódnál, amely igazat ad vissza: (function(){}).constructor === Function.

+ +

Konstruktor

+ +
+
{{jsxref("Function/Function", "Function()")}}
+
Létrehoz egy új Function objektumot. A konstruktor közvetlen meghívásával dinamikusan hozhatók létre függvények, de ez biztonsági és az {{jsxref("eval")}}hoz hasonló (de sokkal kevésbé jelentős) teljesítménybeli problémáktól szenved. Viszont, az evaltól ellentétben, a Function konstruktor olyan függvényeket hoz létre, melyek mindig a globális hatókörben hajtódnak végre.
+
+ +

Példánytulajdonságok

+ +
+
{{jsxref("Function.arguments")}}
+
A függvénynek átadott argumentumokból álló tömb.
+ A {{jsxref("Function")}} elavult tulajdonsága. Helyette az {{jsxref("Functions/arguments", "arguments")}} objektum (a függvényen belül érhető el) használandó.
+
{{jsxref("Function.caller")}}
+
A jelenleg futó függvényt meghívó függvényt adja meg.
+ Ez a tulajdonság elavult, és csak egyes nem szigorú függvényekben működik.
+
{{jsxref("Function.displayName")}}
+
A függvény megjelenítendő neve.
+
{{jsxref("Function.length")}}
+
Megadja a függvény által várt argumentumok számát.
+
{{jsxref("Function.name")}}
+
A függvény neve.
+
+ +

Példánymetódusok

+ +
+
{{jsxref("Function.prototype.apply()", "Function.prototype.apply(thisArg [, argsArray])")}}
+
Meghív egy függvényt, és beállítja a this értékét a megadott thisArg értékre. Az argumentumok {{jsxref("Array")}} objektumként adhatók át.
+
{{jsxref("Function.prototype.bind()", "Function.prototype.bind(thisArg[, arg1[, arg2[, ...argN]]])")}}
+
Létrehoz egy új függvényt, amely meghívásakor beállítja a this értékét a megadott thisArg értékre. Az opcionálisan megadható argumentumsor az új függvény meghívásakor átadott argumentumok elé lesz fűzve.
+
{{jsxref("Function.prototype.call()", "Function.prototype.call(thisArg[, arg1, arg2, ...argN])")}}
+
Meghív egy függvényt, és beállítja a this értékét a megadott értékre. Az argumentumok egyszerűen átadhatók.
+
{{jsxref("Function.prototype.toString()", "Function.prototype.toString()")}}
+
Visszaadja a függvény forráskódját ábrázáló karakterláncot.
+ Felülírja a {{jsxref("Object.prototype.toString")}} metódust.
+
+ +

Példák

+ +

Különbség a Function konstruktor és a függvénydeklaráció között

+ +

A Function konstruktorral létrehozott függvények nem hoznak létre zárványt a létrehozási környezetükhöz, mindig a globális hatókörbe kerülnek. Futtatáskor csak a saját helyi változóit és a globálisakat éri el, a Function konstruktor meghívásakor aktív hatókörben szereplőket nem. Ez különbözik az {{jsxref("eval")}} függvénykifejezésen történő használatától.

+ +
var x = 10;
+
+function createFunction1() {
+    var x = 20;
+    return new Function('return x;'); // az |x| a globális |x|-et jelenti
+}
+
+function createFunction2() {
+    var x = 20;
+    function f() {
+        return x; // ez az |x| a fent lévő helyi |x|-et jelenti
+    }
+    return f;
+}
+
+var f1 = createFunction1();
+console.log(f1());          // 10
+var f2 = createFunction2();
+console.log(f2());          // 20
+
+ +

A kód működik a webböngészőkben, de az f1() ReferenceError hibát okoz Node.js-ben, mert az x nem található. Ez azért van, mert a Node legfelső szintű hatóköre nincs a globális hatókörben, és az x a modulra nézve helyi változó lesz.

+ +

Specifikációk

+ + + + + + + + + + +
Specification
{{SpecName('ESDraft', '#sec-function-objects', 'Function')}}
+ +

Böngészőkompatibilitás

+ +
+ + +

{{Compat("javascript.builtins.Function")}}

+
+ +

Lásd még:

+ +
    +
  • {{jsxref("Functions", "Függvények és függvényhatókör")}}
  • +
  • {{jsxref("Statements/function", "function utasítás")}}
  • +
  • {{jsxref("Operators/function", "function kifejezés")}}
  • +
  • {{jsxref("Statements/function*", "function* utasítás")}}
  • +
  • {{jsxref("Operators/function*", "function* kifejezés")}}
  • +
  • {{jsxref("AsyncFunction")}}
  • +
  • {{jsxref("GeneratorFunction")}}
  • +
diff --git a/files/hu/web/javascript/reference/global_objects/index.html b/files/hu/web/javascript/reference/global_objects/index.html new file mode 100644 index 0000000000..10b4e99123 --- /dev/null +++ b/files/hu/web/javascript/reference/global_objects/index.html @@ -0,0 +1,192 @@ +--- +title: Standard built-in objects +slug: Web/JavaScript/Reference/Global_Objects +tags: + - JavaScript + - NeedsTranslation + - Reference + - TopicStub +translation_of: Web/JavaScript/Reference/Global_Objects +--- +
{{jsSidebar("Objects")}}
+ +

This chapter documents all of JavaScript's standard, built-in objects, including their methods and properties.

+ +
+

The term "global objects" (or standard built-in objects) here is not to be confused with the global object. Here, global objects refer to objects in the global scope (but only if ECMAScript 5 strict mode is not used; in that case it returns {{jsxref("undefined")}}). The global object itself can be accessed using the {{jsxref("Operators/this", "this")}} operator in the global scope. In fact, the global scope consists of the properties of the global object, including inherited properties, if any.

+ +

Other objects in the global scope are either created by the user script or provided by the host application. The host objects available in browser contexts are documented in the API reference. For more information about the distinction between the DOM and core JavaScript, see JavaScript technologies overview.

+ +

Standard objects by category

+ +

Value properties

+ +

These global properties return a simple value; they have no properties or methods.

+ +
    +
  • {{jsxref("Infinity")}}
  • +
  • {{jsxref("NaN")}}
  • +
  • {{jsxref("undefined")}}
  • +
  • {{jsxref("null")}} literal
  • +
+ +

Function properties

+ +

These global functions—functions which are called globally rather than on an object—directly return their results to the caller.

+ +
    +
  • {{jsxref("Global_Objects/eval", "eval()")}}
  • +
  • {{jsxref("Global_Objects/uneval", "uneval()")}} {{non-standard_inline}}
  • +
  • {{jsxref("Global_Objects/isFinite", "isFinite()")}}
  • +
  • {{jsxref("Global_Objects/isNaN", "isNaN()")}}
  • +
  • {{jsxref("Global_Objects/parseFloat", "parseFloat()")}}
  • +
  • {{jsxref("Global_Objects/parseInt", "parseInt()")}}
  • +
  • {{jsxref("Global_Objects/decodeURI", "decodeURI()")}}
  • +
  • {{jsxref("Global_Objects/decodeURIComponent", "decodeURIComponent()")}}
  • +
  • {{jsxref("Global_Objects/encodeURI", "encodeURI()")}}
  • +
  • {{jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent()")}}
  • +
  • {{jsxref("Global_Objects/escape", "escape()")}} {{deprecated_inline}}
  • +
  • {{jsxref("Global_Objects/unescape", "unescape()")}} {{deprecated_inline}}
  • +
+ +

Fundamental objects

+ +

These are the fundamental, basic objects upon which all other objects are based. This includes objects that represent general objects, functions, and errors.

+ +
    +
  • {{jsxref("Object")}}
  • +
  • {{jsxref("Function")}}
  • +
  • {{jsxref("Boolean")}}
  • +
  • {{jsxref("Symbol")}}
  • +
  • {{jsxref("Error")}}
  • +
  • {{jsxref("EvalError")}}
  • +
  • {{jsxref("InternalError")}}
  • +
  • {{jsxref("RangeError")}}
  • +
  • {{jsxref("ReferenceError")}}
  • +
  • {{jsxref("SyntaxError")}}
  • +
  • {{jsxref("TypeError")}}
  • +
  • {{jsxref("URIError")}}
  • +
+ +

Numbers and dates

+ +

These are the base objects representing numbers, dates, and mathematical calculations.

+ +
    +
  • {{jsxref("Number")}}
  • +
  • {{jsxref("Math")}}
  • +
  • {{jsxref("Date")}}
  • +
+ +

Text processing

+ +

These objects represent strings and support manipulating them.

+ +
    +
  • {{jsxref("String")}}
  • +
  • {{jsxref("RegExp")}}
  • +
+ +

Indexed collections

+ +

These objects represent collections of data which are ordered by an index value. This includes (typed) arrays and array-like constructs.

+ +
    +
  • {{jsxref("Array")}}
  • +
  • {{jsxref("Int8Array")}}
  • +
  • {{jsxref("Uint8Array")}}
  • +
  • {{jsxref("Uint8ClampedArray")}}
  • +
  • {{jsxref("Int16Array")}}
  • +
  • {{jsxref("Uint16Array")}}
  • +
  • {{jsxref("Int32Array")}}
  • +
  • {{jsxref("Uint32Array")}}
  • +
  • {{jsxref("Float32Array")}}
  • +
  • {{jsxref("Float64Array")}}
  • +
+ +

Keyed collections

+ +

These objects represent collections which use keys; these contain elements which are iterable in the order of insertion.

+ +
    +
  • {{jsxref("Map")}}
  • +
  • {{jsxref("Set")}}
  • +
  • {{jsxref("WeakMap")}}
  • +
  • {{jsxref("WeakSet")}}
  • +
+ +

Vector collections

+ +

{{Glossary("SIMD")}} vector data types are objects where data is arranged into lanes.

+ +
    +
  • {{jsxref("SIMD")}} {{experimental_inline}}
  • +
  • {{jsxref("Float32x4", "SIMD.Float32x4")}} {{experimental_inline}}
  • +
  • {{jsxref("Float64x2", "SIMD.Float64x2")}} {{experimental_inline}}
  • +
  • {{jsxref("Int8x16", "SIMD.Int8x16")}} {{experimental_inline}}
  • +
  • {{jsxref("Int16x8", "SIMD.Int16x8")}} {{experimental_inline}}
  • +
  • {{jsxref("Int32x4", "SIMD.Int32x4")}} {{experimental_inline}}
  • +
  • {{jsxref("Uint8x16", "SIMD.Uint8x16")}} {{experimental_inline}}
  • +
  • {{jsxref("Uint16x8", "SIMD.Uint16x8")}} {{experimental_inline}}
  • +
  • {{jsxref("Uint32x4", "SIMD.Uint32x4")}} {{experimental_inline}}
  • +
  • {{jsxref("Bool8x16", "SIMD.Bool8x16")}} {{experimental_inline}}
  • +
  • {{jsxref("Bool16x8", "SIMD.Bool16x8")}} {{experimental_inline}}
  • +
  • {{jsxref("Bool32x4", "SIMD.Bool32x4")}} {{experimental_inline}}
  • +
  • {{jsxref("Bool64x2", "SIMD.Bool64x2")}} {{experimental_inline}}
  • +
+ +

Structured data

+ +

These objects represent and interact with structured data buffers and data coded using JavaScript Object Notation (JSON).

+ +
    +
  • {{jsxref("ArrayBuffer")}}
  • +
  • {{jsxref("SharedArrayBuffer")}} {{experimental_inline}}
  • +
  • {{jsxref("Atomics")}} {{experimental_inline}}
  • +
  • {{jsxref("DataView")}}
  • +
  • {{jsxref("JSON")}}
  • +
+ +

Control abstraction objects

+ +
    +
  • {{jsxref("Promise")}}
  • +
  • {{jsxref("Generator")}}
  • +
  • {{jsxref("GeneratorFunction")}}
  • +
  • {{experimental_inline}} {{jsxref("AsyncFunction")}}
  • +
+ +

Reflection

+ +
    +
  • {{jsxref("Reflect")}}
  • +
  • {{jsxref("Proxy")}}
  • +
+ +

Internationalization

+ +

Additions to the ECMAScript core for language-sensitive functionalities.

+ +
    +
  • {{jsxref("Intl")}}
  • +
  • {{jsxref("Global_Objects/Collator", "Intl.Collator")}}
  • +
  • {{jsxref("Global_Objects/DateTimeFormat", "Intl.DateTimeFormat")}}
  • +
  • {{jsxref("Global_Objects/NumberFormat", "Intl.NumberFormat")}}
  • +
+ +

Non-standard objects

+ +
    +
  • {{jsxref("Iterator")}} {{non-standard_inline}}
  • +
  • {{jsxref("ParallelArray")}} {{non-standard_inline}}
  • +
  • {{jsxref("StopIteration")}} {{non-standard_inline}}
  • +
+ +

Other

+ + +
+ +

 

diff --git a/files/hu/web/javascript/reference/global_objects/nan/index.html b/files/hu/web/javascript/reference/global_objects/nan/index.html new file mode 100644 index 0000000000..16d2c13c79 --- /dev/null +++ b/files/hu/web/javascript/reference/global_objects/nan/index.html @@ -0,0 +1,96 @@ +--- +title: NaN +slug: Web/JavaScript/Reference/Global_Objects/NaN +tags: + - JavaScript + - NaN + - Referencia + - Változó +translation_of: Web/JavaScript/Reference/Global_Objects/NaN +--- +
{{jsSidebar("Objects")}}
+ +

A globális NaN egy olyan változó, ami a Not-A-Number típusú értéket reprezentálja.

+ +

{{js_property_attributes(0,0,0)}}

+ +
{{EmbedInteractiveExample("pages/js/globalprops-nan.html")}}
+ + + +

Leírás

+ +

A NaN a globális objektum része. Más szavakkal a globális scope egyik változója.

+ +

A NaN eredeti jelentése: Not-A-Number (nem szám). Értéke a {{jsxref("Number.NaN")}}-nal egyenlő. Modern böngészőkben a NaN nem beállítható, nem írható változó. Ellenkező esetben sem tanácsolt felüldefiniálni. A NaN közvetlen használata egy programban igen ritka.

+ +

Öt különböző típusú műveletet különböztethetünk meg, aminek az eredménye NaN:

+ +
    +
  • A szám nem értelmezhető (pl.: parseInt("blabla") vagy Number(undefined))
  • +
  • Olyan matematikai művelet, ahol a végeredmény nem valós szám (pl.: Math.sqrt(-1))
  • +
  • Olyan művelet, ahol bármelyik operandus maga is NaN (pl.: 7 ** NaN)
  • +
  • Nem meghatározható alak (pl.: 0 * Infinity, vagy undefined + undefined)
  • +
  • Bármilyen művelet, ami szöveggel operál és nem összeadás, vagy hozzáfűzés (pl.: "foo" / 3)
  • +
+ +

Példák

+ +

Tesztelés NaN esetre

+ +

NaN nem összehasonlítható (az ==, !=, ===, és !== operátorokkal) semmilyen más értékkel. -- beleértve magát a NaN értéket. Ahhoz, hogy valamiről biztosan eldöntsük, hogy NaN a {{jsxref("Number.isNaN()")}}, illetve a {{jsxref("Global_Objects/isNaN", "isNaN()")}} függvényeket használhatjuk. Alternatívaként összehasonlíthatjuk a változót saját magával, mert a NaN, és csak is a NaN az az érték, ami nem egyenlő önmagával.

+ +
NaN === NaN;        // false
+Number.NaN === NaN; // false
+isNaN(NaN);         // true
+isNaN(Number.NaN);  // true
+Number.isNaN(NaN);  // true
+
+function valueIsNaN(v) { return v !== v; }
+valueIsNaN(1);          // false
+valueIsNaN(NaN);        // true
+valueIsNaN(Number.NaN); // true
+
+ +

Fontos felhívni a figyelmet az isNaN() és a Number.isNaN() közötti különbséget: míg az előbbi true-val tér vissza akkor is, ha az érték éppen NaN, és akkor is ha az a kiértékelés után NaN-ná válik, úgy az utóbbi csak akkor tér vissza true-val, ha az érték éppen NaN:

+ +
isNaN('hello world');        // true
+Number.isNaN('hello world'); // false
+
+ +

Továbbá, bizonyos tömbfüggvények nem használhatók a NaN keresésére, míg vannak, amik igen.

+ +
let arr = [2, 4, NaN, 12];
+arr.indexOf(NaN);                      // -1 (false)
+arr.includes(NaN);                     // true
+arr.findIndex(n => Number.isNaN(n));   // 2
+
+ +

Specifikáció

+ + + + + + + + + + + + +
Specifikáció
{{SpecName('ESDraft', '#sec-value-properties-of-the-global-object-nan', 'NaN')}}
+ +

Böngésző kompatibilitás

+ + + +

{{Compat("javascript.builtins.NaN")}}

+ +

Lásd még

+ +
    +
  • {{jsxref("Number.NaN")}}
  • +
  • {{jsxref("Number.isNaN()")}}
  • +
  • {{jsxref("isNaN", "isNaN()")}}
  • +
diff --git a/files/hu/web/javascript/reference/global_objects/string/index.html b/files/hu/web/javascript/reference/global_objects/string/index.html new file mode 100644 index 0000000000..4f91f13008 --- /dev/null +++ b/files/hu/web/javascript/reference/global_objects/string/index.html @@ -0,0 +1,307 @@ +--- +title: String +slug: Web/JavaScript/Reference/Global_Objects/String +tags: + - húzáskérvény +translation_of: Web/JavaScript/Reference/Global_Objects/String +--- +
{{JSRef}}
+ +

A String konstruktorral létrehozhatunk karakterláncokat (szövegek szinte mindenhol jelenlévő reprezentációja)

+ +

Szintaxis

+ +

A sztringliterálok a következő formájúak:

+ +
'sztring szöveg'
+"sztring szöveg"
+"中文 español Deutsch English देवनागरी العربية português বাংলা русский 日本語 norsk bokmål ਪੰਜਾਬੀ 한국어 தமிழ் עברית"
+ +

Sztringeket létrehozhatunk a String globális objektummal közvetlenül:

+ +
String(valami)
+ +

Paraméterek

+ +
+
valami
+
Bármi, ami sztringgé alakítható.
+
+ +

Sablon literálok

+ +

Az ECMAScript 2015-tel kezdődően, a sztringliterálok ún. Template literal-ok is lehetnek:

+ +
`hello világ`
+`hello!
+ world!`
+`hello ${who}`
+tag `<a>${who}</a>`
+ +

Itt a ${who} helyére a megfelelő érték fog behelyettsítődni.

+ +

Escape jelölés

+ +

Egyes karakterek összezavarhatnák a JavaScript értelmezőt. Például egy " karakterről hogyan tufná megállapítani, hogy a karakterlánc végét jelöli, vagy annak része? Erre találták ki az escape jelölést, aminek segítségével jelölhetjük, hogy egy karakternek nincs speciális szerepe, nem kell programkódként értelmezni. Lényegében az történik, hogy a feldolgozott karakterláncban az escape karakter (például a \") helyére az annak megfelelő kimenet (") kerül.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KódKimenet
\XXXoktális Latin-1 karakter.
\'egyszeres idézőjel
\"idézőjel
\\backslash
\núj sor (soremelés)
\rkocsi-vissza
\vfüggőleges tabulátor
\ttabulátor
\bbackspace
\flapdobás
\uXXXXunicode kódpont
\u{X} ... \u{XXXXXX}unicode kódpont {{experimental_inline}}
\xXXhexadecimális Latin-1 karakter
+ +
+

Más nyelvekkel ellentétben a JavaScript nem különbözteti meg az egyszeres, illetve a kettős idézőjelekkel hivatkozott sztringeket; ezért a fenti escape szekvenciák mind az egyszeres, mind a kettős idézőjelekkel létrehozott sztringek esetén működnek.

+
+ +

Hosszú sztring literálok

+ +

Időnként a kódban szerepelhetnek nagyon hosszú sztringek. Vég nélkül folytatódó, illetve a szerkesztőprogram kénye-kedve szerint megtört sorok helyett lehetséges a sztringek több sorba tördelése a tartalom meghagyásával. Erre két mód van.

+ +

Használhatjuk a + operátort több füzér összefűzéséhez, így:

+ +
let longString = "Ez egy elég hosszú String ahhoz " +
+                 "hogy több sorba rendezzem, mert " +
+                 "máskülönben a kód nem olvasható.";
+
+ +

Vagy használható a backslash karakter ("\") az összes sor végén, jelölve, hogy a sztring a következő sorban folytatódik. Győződjünk meg róla, hogy nincs szóköz vagy más karakter a backslash után (soremelés kivételével), akár bekezdésként, különben nem fog működni. Ennek formája a kövekező:

+ +
let longString = "This is a very long string which needs \
+to wrap across multiple lines because \
+otherwise my code is unreadable.";
+
+ +

Mindkét forma a példában azonos sztringek létrehozását eredményezi.

+ +

Leírás

+ +

A stringek szöveges formában ábrázolt adatok tárolására használhatók. A leggyakoribb sztringműveletek közé tartozik a {{jsxref("String.length", "hossz")}} vizsgálata, azok felépítése és összefűzése a + és += sztring operátorokkal, alfüzérek meglétének és helyének vizsgálata a {{jsxref("String.prototype.indexOf()", "indexOf()")}} metódussal, illetve alfüzérek lekérdezése a {{jsxref("String.prototype.substring()", "substring()")}} metódussal.

+ +

Karakter hozzáférés

+ +

Kétféle mód van egy sztringben az egyes karakterekhez vakó hozzáféréshez. Az egyik a {{jsxref("String.prototype.charAt()", "charAt()")}} metódus:

+ +
return 'macska'.charAt(1); // "a"-val tér vissza
+
+ +

A másik mód (bevezetve az ECMAScript 5-ben) tömbszerű objektumként kezeli a sztringet, ahol az egyes karaktereknem számindexek felelnek meg:

+ +
return 'macska'[1]; // "a"-val tér vissza
+
+ +

Törölni vagy megváltoztatni e tulajdonságokat karakter hozzáféréssel nem lehet a szögletes zárójeles jelölés esetén. A szóban forgó tulajdonságok nem írhatók és nem is konfigurálhatók. (Lásd a {{jsxref("Object.defineProperty()")}} cikket további információért.)

+ +

Sztringek összehasonlítása

+ +

C fejlesztőknek ismerős lehet a strcmp() függvény sztringek összehasonlításához. A JavaScript-ben a kisebb és nagyobb operátorok használhatók:

+ +
var a = 'a';
+var b = 'b';
+if (a < b) { // true
+  console.log(a + ' kisebb, mint ' + b);
+} else if (a > b) {
+  console.log(a + ' nagyobb, mint ' + b);
+} else {
+  console.log(a + ' és ' + b + ' egyenlők.');
+}
+
+ +

Hasonlót eredményez a {{jsxref("String.prototype.localeCompare()", "localeCompare()")}} metódus, amelyet a String példányok örökölnek.

+ +

Sztring primitívek és String objektumok megkülönböztetése

+ +

Jegyezzük meg, hogy a JavaScript különbséget tesz String objektumok és primitív sztring értékek között. (Ugyanez igaz {{jsxref("Boolean")}} és {{jsxref("Global_Objects/Number", "Number")}} objektumokra.)

+ +

Sztringliterálok (egyszeri vagy kettős idézőjellel jelölve) és a String hívásából visszatérő, nem konstruktor kontextusból (azaz, nem a {{jsxref("Operators/new", "new")}} kulcsszó használatával) kapott sztringek primitív sztringek. A JavaScript automatikusan String objektumokká alakítja a primitíveket, hogy eképpen a String objektum metódusai primitív sztringeken is használhatók legyenek. Amikor primitív sztringen hívódik metódus vagy tulajdonság lekérdezés, a JavaScript automatikusan String objektummá alakítja a sztringet és így hívja meg a metódust, illetve a lekérdezést.

+ +
var s_prim = 'foo';
+var s_obj = new String(s_prim);
+
+console.log(typeof s_prim); // Konzol kimenet: "string"
+console.log(typeof s_obj);  // Konzol kimenet: "object"
+
+ +

Sztring primitívek és String objektumok az {{jsxref("Global_Objects/eval", "eval()")}} használatakor is különböző eredményt adnak. Az eval számára átadott primitívek forráskódként vannak kezelve, míg a String objektumok, mint bármely más átadott objektum esetén, az objektum visszaadását eredményezik. Például:

+ +
var s1 = '2 + 2';             // létrehoz egy sztring primitívet
+var s2 = new String('2 + 2'); // létrehoz egy String objektumot
+console.log(eval(s1));        // a 4 számmal tér vissza
+console.log(eval(s2));        // a "2 + 2" sztringgel tér vissza
+
+ +

Ezen okok miatt a kód hibás működését okozhatja, amikor String a kód String objektumot kap, miközben primitív sztringet vár, bár általában nem szükséges a fejlesztőknek ezzel törődni.

+ +

Egy String objektum mindig átalakítható a primitív megfelelőjére a  {{jsxref("String.prototype.valueOf()", "valueOf()")}} metódussal.

+ +
console.log(eval(s2.valueOf())); // 4-et ad vissza
+
+ +
Megjegyzés: Egy másik JavaScript-ben lehetséges megközelítésére a sztringeknek, lásd a StringView — a C-like representation of strings based on typed arrays cikket.
+ +

Tulajdonságok

+ +
+
{{jsxref("String.prototype")}}
+
Tulajdonságok hozzáadását engedélyezi egy String objektumhoz.
+
+ +

Metódusok

+ +
+
{{jsxref("String.fromCharCode()")}}
+
Unicode értékek meghatározott sorozatával megadott sztringgel tér vissza.
+
{{jsxref("String.fromCodePoint()")}}
+
Kódpontok meghatározott sorozatával megadott sztringgel tér vissza.
+
{{jsxref("String.raw()")}} {{experimental_inline}}
+
Nyers sablon sztring szerint létrehozott sztringgel tér vissza.
+
+ +

String generikus metódusok

+ +
+

A String generikusok nem szabványosak, elavultak és a közeljövőben törlésre kerülnek.

+
+ +

String példánymetódusok a JavaScript 1.6 óta elérhetők Firefox-ban (nem része az ECMAScript szabványnak) a String objektumon bármely objektumon String metódusok alkalmazására:

+ +
var num = 15;
+console.log(String.replace(num, "5", "2"));
+
+ +

A String generikusokról való áttéréshez lásd a Warning: String.x is deprecated; use String.prototype.x instead cikket.

+ +

Tömbök generikusai ({{jsxref("Global_Objects/Array", "Generics", "#Array_generic_methods", 1)}}) a tömb ({{jsxref("Array")}}) metódusokra is elérhetők.

+ +

String példányok

+ +

Tulajdonságok

+ +
{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/prototype', 'Tulajdonságok')}}
+ +

Metódusok

+ +

HTML-hez nem kapcsolódó metódusok

+ +
{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/prototype', 'Methods_unrelated_to_HTML')}}
+ +

HTML wrapper methods

+ +
{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/prototype', 'HTML_wrapper_methods')}}
+ +

Példák

+ +

String konverzió

+ +

A String használható egy biztonságosabb {{jsxref("String.prototype.toString()", "toString()")}} alternatívaként, mivel {{jsxref("null")}}, {{jsxref("undefined")}}, és {{jsxref("Symbol", "symbol")}} objektumokra is használható. Például:

+ +
var outputStrings = [];
+for (var i = 0, n = inputValues.length; i < n; ++i) {
+  outputStrings.push(String(inputValues[i]));
+}
+
+ +

Specifikációk

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificációStátuszMegjegyzés
{{SpecName('ESDraft', '#sec-string-objects', 'String')}}{{Spec2('ESDraft')}}
{{SpecName('ES2015', '#sec-string-objects', 'String')}}{{Spec2('ES2015')}}
{{SpecName('ES5.1', '#sec-15.5', 'String')}}{{Spec2('ES5.1')}}
{{SpecName('ES1')}}{{Spec2('ES1')}}Kezdeti definíció.
+ +

Böngésző kompatibilitás

+ + + +

{{Compat("javascript.builtins.String",2)}}

+ +

Lásd még

+ + diff --git a/files/hu/web/javascript/reference/index.html b/files/hu/web/javascript/reference/index.html new file mode 100644 index 0000000000..08006f6ab5 --- /dev/null +++ b/files/hu/web/javascript/reference/index.html @@ -0,0 +1,197 @@ +--- +title: JavaScript reference +slug: Web/JavaScript/Reference +tags: + - JavaScript + - NeedsTranslation + - TopicStub +translation_of: Web/JavaScript/Reference +--- +
{{JsSidebar}}
+ +

Ez a része a JavaScript szekciónak ténylek tárolójaként szolgál a JavaScript nyelvről az MDN szerverein. Olvass tovább erről a hivatkozásról.

+ +

Globális objektumok

+ +

Ez a fejezet dokumentálja a JavaScript összes szabványos, beépített objektumait, a metódusaikkal és tulajdonságaikkal együtt.

+ +
{{page('/hu/docs/Web/JavaScript/Reference/Global_Objects', 'Standard objects (by category)')}}
+ +
+ +
+

Értéket kifejező objektumok

+ +
    +
  • {{JSxRef("Infinity")}}
  • +
  • {{JSxRef("Global_Objects/NaN","NaN")}}
  • +
  • {{JSxRef("undefined")}}
  • +
  • {{JSxRef("globalThis")}}
  • +
+ +

Függvény objektumok

+ +
    +
  • {{JSxRef("Global_Objects/eval", "eval()")}}
  • +
  • {{JSxRef("Global_Objects/isFinite", "isFinite()")}}
  • +
  • {{JSxRef("Global_Objects/isNaN", "isNaN()")}}
  • +
  • {{JSxRef("Global_Objects/parseFloat", "parseFloat()")}}
  • +
  • {{JSxRef("Global_Objects/parseInt", "parseInt()")}}
  • +
  • {{JSxRef("Global_Objects/decodeURI", "decodeURI()")}}
  • +
  • {{JSxRef("Global_Objects/decodeURIComponent", "decodeURIComponent()")}}
  • +
  • {{JSxRef("Global_Objects/encodeURI", "encodeURI()")}}
  • +
  • {{JSxRef("Global_Objects/encodeURIComponent", "encodeURIComponent()")}}
  • +
+ +

Alapvető objektumok

+ +
    +
  • {{JSxRef("Object")}}
  • +
  • {{JSxRef("Function")}}
  • +
  • {{JSxRef("Boolean")}}
  • +
  • {{JSxRef("Symbol")}}
  • +
+ +

Hiba objektumok

+ +
    +
  • {{JSxRef("Error")}}
  • +
  • {{JSxRef("AggregateError")}}
  • +
  • {{JSxRef("EvalError")}}
  • +
  • {{JSxRef("InternalError")}}
  • +
  • {{JSxRef("RangeError")}}
  • +
  • {{JSxRef("ReferenceError")}}
  • +
  • {{JSxRef("SyntaxError")}}
  • +
  • {{JSxRef("TypeError")}}
  • +
  • {{JSxRef("URIError")}}
  • +
+ +

Számok és Dátumok

+ +
    +
  • {{JSxRef("Number")}}
  • +
  • {{JSxRef("BigInt")}}
  • +
  • {{JSxRef("Math")}}
  • +
  • {{JSxRef("Date")}}
  • +
+ +

Szövegkezelés

+ +
    +
  • {{JSxRef("String")}}
  • +
  • {{JSxRef("RegExp")}}
  • +
+ +

Számozott gyűjtemények (tömbök)

+ +
    +
  • {{JSxRef("Array")}}
  • +
  • {{JSxRef("Int8Array")}}
  • +
  • {{JSxRef("Uint8Array")}}
  • +
  • {{JSxRef("Uint8ClampedArray")}}
  • +
  • {{JSxRef("Int16Array")}}
  • +
  • {{JSxRef("Uint16Array")}}
  • +
  • {{JSxRef("Int32Array")}}
  • +
  • {{JSxRef("Uint32Array")}}
  • +
  • {{JSxRef("Float32Array")}}
  • +
  • {{JSxRef("Float64Array")}}
  • +
  • {{JSxRef("BigInt64Array")}}
  • +
  • {{JSxRef("BigUint64Array")}}
  • +
+ +

Referált gyűjtemények (leképezések)

+ +
    +
  • {{JSxRef("Map")}}
  • +
  • {{JSxRef("Set")}}
  • +
  • {{JSxRef("WeakMap")}}
  • +
  • {{JSxRef("WeakSet")}}
  • +
+ +

Adatstruktúrák

+ +
    +
  • {{JSxRef("ArrayBuffer")}}
  • +
  • {{JSxRef("SharedArrayBuffer")}}
  • +
  • {{JSxRef("Atomics")}}
  • +
  • {{JSxRef("DataView")}}
  • +
  • {{JSxRef("JSON")}}
  • +
+ +

Control absztrakció

+ +
    +
  • {{JSxRef("GeneratorFunction")}}
  • +
  • {{JSxRef("AsyncGeneratorFunction")}}
  • +
  • {{JSxRef("Generator")}}
  • +
  • {{JSxRef("AsyncGenerator")}}
  • +
  • {{JSxRef("AsyncFunction")}}
  • +
  • {{JSxRef("Promise")}}
  • +
+ +

Reflexió

+ +
    +
  • {{JSxRef("Reflect")}}
  • +
  • {{JSxRef("Proxy")}}
  • +
+ +

Nemzetközi szabványok

+ +
    +
  • {{JSxRef("Intl")}}
  • +
  • {{JSxRef("Global_Objects/Intl/Collator", "Intl.Collator")}}
  • +
  • {{JSxRef("Global_Objects/Intl/DateTimeFormat", "Intl.DateTimeFormat")}}
  • +
  • {{JSxRef("Global_Objects/Intl/DisplayNames", "Intl.DisplayNames")}}
  • +
  • {{JSxRef("Global_Objects/Intl/ListFormat", "Intl.ListFormat")}}
  • +
  • {{JSxRef("Global_Objects/Intl/Locale", "Intl.Locale")}}
  • +
  • {{JSxRef("Global_Objects/Intl/NumberFormat", "Intl.NumberFormat")}}
  • +
  • {{JSxRef("Global_Objects/Intl/PluralRules", "Intl.PluralRules")}}
  • +
  • {{JSxRef("Global_Objects/Intl/RelativeTimeFormat", "Intl.RelativeTimeFormat")}}
  • +
+ +

Webfejlesztés

+ +
    +
  • {{JSxRef("WebAssembly")}}
  • +
  • {{JSxRef("WebAssembly.Module")}}
  • +
  • {{JSxRef("WebAssembly.Instance")}}
  • +
  • {{JSxRef("WebAssembly.Memory")}}
  • +
  • {{JSxRef("WebAssembly.Table")}}
  • +
  • {{JSxRef("WebAssembly.CompileError")}}
  • +
  • {{JSxRef("WebAssembly.LinkError")}}
  • +
  • {{JSxRef("WebAssembly.RuntimeError")}}
  • +
+
+ +

Utasítások

+ +

Ez a fejezet dokumentálja az összes JavaScript utasítást és deklarációt.

+ +
{{page('/en-US/docs/Web/JavaScript/Reference/Statements', 'Statements_and_declarations_by_category')}}
+ +

Kifejezések és operátorok

+ +

Ez a fejezet dokumentálja az összes JavaScript kifejezést és operátort.

+ +
{{page('/en-US/docs/Web/JavaScript/Reference/Operators', 'Expressions_and_operators_by_category')}}
+ +

Függvények

+ +

Ezen fejezet dokumentációja megmutatja, hogyan dolgozz JavaScript függvényekkel a saját alkalmazásaid fejlesztéséhez.

+ + + +

További referencia oldalak

+ + diff --git a/files/hu/web/javascript/reference/statements/index.html b/files/hu/web/javascript/reference/statements/index.html new file mode 100644 index 0000000000..368977efc8 --- /dev/null +++ b/files/hu/web/javascript/reference/statements/index.html @@ -0,0 +1,131 @@ +--- +title: Statements and declarations +slug: Web/JavaScript/Reference/Statements +tags: + - JavaScript + - NeedsTranslation + - Reference + - TopicStub + - statements +translation_of: Web/JavaScript/Reference/Statements +--- +
{{jsSidebar("Statements")}}
+ +

JavaScript applications consist of statements with an appropriate syntax. A single statement may span multiple lines. Multiple statements may occur on a single line if each statement is separated by a semicolon. This isn't a keyword, but a group of keywords.

+ +

Statements and declarations by category

+ +

For an alphabetical listing see the sidebar on the left.

+ +

Control flow

+ +
+
{{jsxref("Statements/block", "Block")}}
+
A block statement is used to group zero or more statements. The block is delimited by a pair of curly brackets.
+
{{jsxref("Statements/break", "break")}}
+
Terminates the current loop, switch, or label statement and transfers program control to the statement following the terminated statement.
+
{{jsxref("Statements/continue", "continue")}}
+
Terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration.
+
{{jsxref("Statements/Empty", "Empty")}}
+
An empty statement is used to provide no statement, although the JavaScript syntax would expect one.
+
{{jsxref("Statements/if...else", "if...else")}}
+
Executes a statement if a specified condition is true. If the condition is false, another statement can be executed.
+
{{jsxref("Statements/switch", "switch")}}
+
Evaluates an expression, matching the expression's value to a case clause, and executes statements associated with that case.
+
{{jsxref("Statements/throw", "throw")}}
+
Throws a user-defined exception.
+
{{jsxref("Statements/try...catch", "try...catch")}}
+
Marks a block of statements to try, and specifies a response, should an exception be thrown.
+
+ +

Declarations

+ +
+
{{jsxref("Statements/var", "var")}}
+
Declares a variable, optionally initializing it to a value.
+
{{experimental_inline}} {{jsxref("Statements/let", "let")}}
+
Declares a block scope local variable, optionally initializing it to a value.
+
{{experimental_inline}} {{jsxref("Statements/const", "const")}}
+
Declares a read-only named constant.
+
+ +

Functions and classes

+ +
+
{{jsxref("Statements/function", "function")}}
+
Declares a function with the specified parameters.
+
{{experimental_inline}} {{jsxref("Statements/function*", "function*")}}
+
Generators functions enable writing iterators more easily.
+
{{jsxref("Statements/return", "return")}}
+
Specifies the value to be returned by a function.
+
{{experimental_inline}} {{jsxref("Statements/class", "class")}}
+
Declares a class.
+
+ +

Iterations

+ +
+
{{jsxref("Statements/do...while", "do...while")}}
+
Creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once.
+
{{jsxref("Statements/for", "for")}}
+
Creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop.
+
{{deprecated_inline}} {{non-standard_inline()}} {{jsxref("Statements/for_each...in", "for each...in")}}
+
Iterates a specified variable over all values of object's properties. For each distinct property, a specified statement is executed.
+
{{jsxref("Statements/for...in", "for...in")}}
+
Iterates over the enumerable properties of an object, in arbitrary order. For each distinct property, statements can be executed.
+
{{experimental_inline}} {{jsxref("Statements/for...of", "for...of")}}
+
Iterates over iterable objects (including arrays, array-like objects, iterators and generators), invoking a custom iteration hook with statements to be executed for the value of each distinct property.
+
{{jsxref("Statements/while", "while")}}
+
Creates a loop that executes a specified statement as long as the test condition evaluates to true. The condition is evaluated before executing the statement.
+
+ +

Others

+ +
+
{{jsxref("Statements/debugger", "debugger")}}
+
Invokes any available debugging functionality. If no debugging functionality is available, this statement has no effect.
+
{{experimental_inline}} {{jsxref("Statements/export", "export")}}
+
Used to export functions to make them available for imports in external modules, another scripts.
+
{{experimental_inline}} {{jsxref("Statements/import", "import")}}
+
Used to import functions exported from an external module, another script.
+
{{jsxref("Statements/label", "label")}}
+
Provides a statement with an identifier that you can refer to using a break or continue statement.
+
+ +
+
{{deprecated_inline}} {{jsxref("Statements/with", "with")}}
+
Extends the scope chain for a statement.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
ECMAScript 1st Edition.StandardInitial definition.
{{SpecName('ES5.1', '#sec-12', 'Statements')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-ecmascript-language-statements-and-declarations', 'ECMAScript Language: Statements and Declarations')}}{{Spec2('ES6')}}New: function*, let, for...of, yield, class
+ +

See also

+ + diff --git a/files/hu/web/javascript/reference/statements/try...catch/index.html b/files/hu/web/javascript/reference/statements/try...catch/index.html new file mode 100644 index 0000000000..4efd7b1278 --- /dev/null +++ b/files/hu/web/javascript/reference/statements/try...catch/index.html @@ -0,0 +1,321 @@ +--- +title: try...catch +slug: Web/JavaScript/Reference/Statements/try...catch +translation_of: Web/JavaScript/Reference/Statements/try...catch +--- +
{{jsSidebar("Statements")}}
+ +

try...catch szerkezet utasítások futtatására, majd a keletkező kivételek érzékelésére, kezelésére való.

+ +
{{EmbedInteractiveExample("pages/js/statement-trycatch.html")}}
+ +
Megjegyzés: ebben a cikkben a kivétel szó az angol szaknyelvi exception, blokk pedig a block vagy clause szó fordítása.
+ + + +

Szerkezet

+ +
try {
+   try_statements
+}
+[catch (exception_var_1 if condition_1) { // nem szabványos
+   catch_statements_1
+}]
+...
+[catch (exception_var_2) {
+   catch_statements_2
+}]
+[finally {
+   finally_statements
+}]
+ +
+
try_statements
+
Azok az utasítások, amelyek kivételt válthatnak ki.
+
+ +
+
catch_statements_1, catch_statements_2
+
Azok az utasítások, amelyek akkor hajtódnak végre, ha valami kivételt vált ki a try blokkban.
+
+ +
+
exception_var_1, exception_var_2
+
Annak a változónak a neve, amelyben az utána következő catch blokkban elérhető lesz a kivételobjektum (Exception).
+
+ +
+
condition_1
+
Valamilyen feltétel (mint egy if() kifejezésben).
+
+ +
+
finally_statements
+
Azok az utasítások, amelyeket a try blokk után le kell futtatni, tehát ezek attól függetlenül végrehajtódnak, hogy a try blokkban történt-e kivétel.
+
+ +

Kifejtés

+ +

A try szerkezetnek 3 megjelenési formája van:

+ +
    +
  1. try...catch
  2. +
  3. try...finally
  4. +
  5. try...catch...finally
  6. +
+ +

A try, a catch és a finally blokk egy vagy több utasításból állhat. A kapcsos zárójelek használata kötelező, még akkor is, ha egy utasításból áll csak a blokk. A try blokk után legalább egy catch vagy finally blokknak kell lennie.:

+ +

A catch blokk tartalmazza azokat az utasításokat, amelyek akkor hajtódnak végre, ha valami kivételt vált ki a try blokkban. Ha valami kivételt vált ki, a try blokk végrehajtása azonnal megszakad, és a catch blokk hajtódik végre. Ha nem történik kivétel, a catch blokk nem hajtódik végre.

+ +

A finally blokk végrehajtása a try és a catch blokk(ok) végrehajtása után, közvetlenül a blokk utáni utasítások előtt. Mindig végrehajtódik, attól függetlenül, hogy a try blokk sikeres volt-e.

+ +

A try szerkezetek egymásba ágyazhatóak. Ha egy beágyazott try blokkhoz nem tartozik catch blokk, az azt tartalmazó try blokkhoz tartozó catch/finally fog végrehajtódni.

+ +

A try szerkezettel a JavaScript kivételeit is lehet kezelni. További információ róluk: JavaScript Guide.

+ +

Feltétel nélküli catch blokk

+ +

Egyszerű, feltétel nélküli catch blokk esetén bármilyen kivétel váltódik ki, ugyanaz a blokk fog végrehajtódni. Például

+ +
try {
+   throw 'myException'; // generates an exception
+}
+catch (e) {
+   // statements to handle any exceptions
+   logMyErrors(e); // pass exception object to error handler
+}
+
+ +

A catch blokk használata során meg kell adnunk egy változónevet, ez a változó fogja tárolni a kivételobjektumot. A catch blokkban megadott változó élettartama eltér a szokásostól: a változó a catch blokk végrehajtása előtt jön létre, és a végrehajtás után nem elérhető.

+ +

Feltételes catch blokk

+ +

You can also use one or more conditional catch clauses to handle specific exceptions. In this case, the appropriate catch clause is entered when the specified exception is thrown. In the following example, code in the try block can potentially throw three exceptions: {{jsxref("TypeError")}}, {{jsxref("RangeError")}}, and {{jsxref("EvalError")}}. When an exception occurs, control transfers to the appropriate catch clause. If the exception is not one of the specified exceptions and an unconditional catch clause is found, control transfers to that catch clause.

+ +

If you use an unconditional catch clause with one or more conditional catch clauses, the unconditional catch clause must be specified last. Otherwise, the unconditional catch clause will intercept all types of exception before they can reach the conditional ones.

+ +

Emlékeztető: ez a lehetőség nem az ECMAScript szabvány része.

+ +
try {
+    myroutine(); // may throw three types of exceptions
+} catch (e if e instanceof TypeError) {
+    // statements to handle TypeError exceptions
+} catch (e if e instanceof RangeError) {
+    // statements to handle RangeError exceptions
+} catch (e if e instanceof EvalError) {
+    // statements to handle EvalError exceptions
+} catch (e) {
+    // statements to handle any unspecified exceptions
+    logMyErrors(e); // pass exception object to error handler
+}
+
+ +

Here is the same "Conditional catch clauses" using code that conforms to ECMAScript specification (obviously it's more verbose, but works everywhere):

+ +
try {
+    myroutine(); // may throw three types of exceptions
+} catch (e) {
+    if (e instanceof TypeError) {
+        // statements to handle TypeError exceptions
+    } else if (e instanceof RangeError) {
+        // statements to handle RangeError exceptions
+    } else if (e instanceof EvalError) {
+        // statements to handle EvalError exceptions
+    } else {
+       // statements to handle any unspecified exceptions
+       logMyErrors(e); // pass exception object to error handler
+    }
+}
+
+ +

The exception identifier

+ +

When an exception is thrown in the try block, exception_var (e.g. the e in catch (e)) holds the value specified by the throw statement. You can use this identifier to get information about the exception that was thrown. As of Firefox 58, when the exception is unused, the identifier can be omitted, as in

+ +
function isValidJSON(text) {
+    try {
+        JSON.parse(text);
+        return true;
+    } catch {
+        return false;
+    }
+}
+
+ +

This identifier is local to the catch clause. That is, it is created when the catch clause is entered, and after the catch clause finishes executing, the identifier is no longer available.

+ +

A finally blokk

+ +

A finally blokk azokat az utasításokat tartalmazza, amelyeket a catch blokk(ok) után, de a try-catch-finally szerkezet előtt kell végrehajtani. Mindenképpen végrehajtódik, attól függetlenül, hogy a try blokkban váltódott-e ki kivétel. A finally blokk megléte elfogadhatóvá teszi a catch blokk hiányát, de a kivételek megjelennek a blokkon kívül is. Amennyiben hiányzik a catch blokk, először a try-ban kiváltódott kivételek jelennek meg, majd ezután hajtódik végre a finally blokk.

+ +

A finally blokkot gyakran használják a program hiba esetén történő leállása előtti feladatok elvégzésére.

+ +

Enyhén szólva furcsának tűnhet, hogy a JavaScript kivételekhez kapcsolódó részében szerepel egy olyan ág is, ami attól függetlenül végrehajtódik, hogy váltódott-e ki kivétel. Ennek azomban, a látszattal ellentétben van értelme. A hangsúly nem azon van, hogy a finally blokk mindig végrehajtódik, hanem hogy az azt követő utasítások nem feltétlenül.

+ +

Például ha egy másik kivétel váltódik ki egy try-catch blokkon belül, semmilyen más kód ugyanabban a külső try-catch blokkban nem fog végrehajtódni.

+ +

For instance, if another exception occurs inside a try's catch-block, any remaining code in the same outer try-block enclosing that try..catch (or in the main flow, if not in an outer try-block) , will not get executed, since control is immediately transferred to the outer try's catch-block (or the internal error-generator, if not in a try-block).  

+ +

Thus, any routine cleanup code done in that enclosed (or the main) section before it exits, will be skipped.  However, If the try-block has a finally-block, then that finally-block code will be executed first to permit any such cleanup, and THEN the other try's catch-block (or the error-generator) will get control to handle the second exception.  

+ +

Now, if that routine cleanup must be done whether or not the try..catch code succeeds, then if the finally-block only executed after an exception, the same cleanup code would have to be duplicated both inside and outside the finally-block, and therefore there is no reason not to have just the finally-block alone, and let it execute regardless of exceptions or not.

+ +

The following example opens a file and then executes statements that use the file (server-side JavaScript allows you to access files). If an exception is thrown while the file is open, the finally clause closes the file before the script fails. The code in finally also executes upon explicitly returning from try or catch block.

+ +
openMyFile();
+try {
+   // tie up a resource
+   writeMyFile(theData);
+}
+finally {
+   closeMyFile(); // always close the resource
+}
+
+ +

Példák

+ +

Beágyazott try blokkok

+ +

Először is, nézzük meg ezt:

+ +
try {
+  try {
+    throw new Error('hoppácska');
+  }
+  finally {
+    console.log('finally blokk');
+  }
+}
+catch (ex) {
+  console.error('külső catch blokk', ex.message);
+}
+
+// Kimenet:
+// "finally blokk"
+// "külső catch blokk" "hoppácska"
+
+ +

Now, if we already caught the exception in the inner try-block by adding a catch block

+ +
try {
+  try {
+    throw new Error('hoppácska');
+  }
+  catch (ex) {
+    console.error('belső catch blokk', ex.message);
+  }
+  finally {
+    console.log('finally blokk');
+  }
+}
+catch (ex) {
+  console.error('outer', ex.message);
+}
+
+// Kimenet:
+// "belső catch blokk" "hoppácska"
+// "finally blokk"
+
+ +

Most pedig dobjuk tovább a kivételt:

+ +
try {
+  try {
+    throw new Error('hoppácska');
+  }
+  catch (ex) {
+    console.error('belső catck blokk', ex.message);
+    throw ex;
+  }
+  finally {
+    console.log('finally blokk');
+  }
+}
+catch (ex) {
+  console.error('külső catck blokk', ex.message);
+}
+
+// Output:
+// "belső catck blokk" "hoppácska"
+// "finally blokk"
+// "külső catck blokk" "hoppácska"
+
+ +

Minden kivételt csak a legközelebbi catch blokk fog elkapni, kivéve ha innen tovább dobjuk. Ez esetben a belső catch blokkból dobott kivételt a külső try-hez tartozó catch blokk fogja elkapni.

+ +

return használata a finally blokkban

+ +

Ha a finally blokk értéket ad vissza, ez az érték a teljes try-catch-finally szerkezet vissszatérési értékévé válik, a try és catch blokkokban lévő return utasításoktól függetlenül. Ebbe beletartoznak a catch blokkon belül dobott kivételek is.

+ +
(function() {
+  try {
+    try {
+      throw new Error('hoppácska');
+    }
+    catch (ex) {
+      console.error('belső catch blokk', ex.message);
+      throw ex;
+    }
+    finally {
+      console.log('finally blokk');
+      return;
+    }
+  }
+  catch (ex) {
+    console.error('külső', ex.message);
+  }
+})();
+
+// Kimenet:
+// "belső catch blokk" "hoppácska"
+// "finally blokk"
+ +

The outer "oops" is not thrown because of the return in the finally block. The same would apply to any value returned from the catch block.

+ +

Specifikációk

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecifikációStátuszMegjegyzés
{{SpecName('ES3')}}{{Spec2('ES3')}} +

Az első leírás. A JavaScript 1.4-ben lett megvalósítva.

+
{{SpecName('ES5.1', '#sec-12.14', 'try statement')}}{{Spec2('ES5.1')}}
{{SpecName('ES6', '#sec-try-statement', 'try statement')}}{{Spec2('ES6')}}
{{SpecName('ESDraft', '#sec-try-statement', 'try statement')}}{{Spec2('ESDraft')}}Nem része a jelenleg ECMA-262 szabványnak: Több catch blokk és feltételes bokkok (SpiderMonkey kiterjesztés, JavaScript 1.5).
+ +

Browser compatibility

+ + + +

{{Compat("javascript.statements.try_catch")}}

+ +

See also

+ +
    +
  • {{jsxref("Error")}}
  • +
  • {{jsxref("Statements/throw", "throw")}}
  • +
diff --git a/files/hu/web/reference/api/index.html b/files/hu/web/reference/api/index.html new file mode 100644 index 0000000000..37a5f4f1cd --- /dev/null +++ b/files/hu/web/reference/api/index.html @@ -0,0 +1,65 @@ +--- +title: Web Alkalmazásprogramozási Felület Referencia +slug: Web/Reference/API +tags: + - API + - Referencia + - Web + - Web dizájn + - Webfejlesztés +translation_of: Web/Reference/API +--- +

A Web az alkalmazásprogramozási felületek (API-ok) széles skáláját kínálja sok különböző hasznos feladat elvégzéséhez segítséget nyújtva. Ezekhez hozzájuthatsz JavaScript kódon keresztül és segítségükkel bármilyen változtatást végrehajthatsz a {{domxref("window")}} -tól és {{domxref("element")}} -tól kezdve egészén bonyolult web grafikák és audio effektekig olyan API-ok segítségével, mint a WebGL és a Web Audio.

+ +

Minden egyes interfész az összes API-on keresztül megtalálható az index-ben.

+ +

Ezen kívül még van egy lista az összes lehetséges eseményről az esemény referenciában.

+ +
+
+
+
Dokumentum Objektum Model
+
A DOM egy API ami hozzáférést és változtatási lehetőséget nyújt a jelenlegi dokumentumban. Engedélyezi, hogy manipuláld a {{domxref("Node")}}-t és a {{domxref("Element")}}-t. A HTML, az XML és az SVG kiterjesztették, hogy manipulálhass egy adott részüket.
+
Eszköz API-ok
+
Ezek az API-ok segítséget nyújtanak abban, hogy hozzáférést nyerj a hardware különböző funkcióihoz, melyek elérhetőek a Weboldalak és applikációk számára. Pl.: Környezeti Fényérzékelő API, Akkumulátor Állapor API, Földrajzi Helymeghatározó API, Egér Zároló API, Proximity API, Eszköz Orientációs API, Képernyő Orientációs API, Vibrációs API.
+
Kommunikációs API-ok
+
Ezek az API-ok engedélyezik a weboldalaknak vagy applikációknak, hogy más oldalakkal vagy eszközökkel kommunikáljanak. Pl.: Hálózati Információs API, Web Értesítések, Simple Push API.
+
Adatkezelő API-ok
+
Felhasználói adat tárolható és kezelhető ezen API-ok segítségével. Pl.: FileHandle API, IndexedDB.
+
+ +

Ezen API-okon kívül, amelyek minden Weboldalnak és applikációnak elérhetők, sokoldaló Mozzila API-ok is elérhetők a kiemelt és hitelesített alkalmazásoknak.

+ +
+
Kiemelt API-ok
+
Egy kiemelt alkalmazás egy olyan feltelepített app, aminek a felhasználó adott bizonyos jogokat. A kiemelt API-ok közé tartozik: TCP Socket API, Kapcsolatok API, Eszköz Tárhely API, Böngésző API, Kamera API.
+
Hitelesített API-ok
+
Egy hiteles applikació egy alacsony szintű applikáció, ami kritikus operációkat hajt végre operációs rendszerek esetében mint a Firefox OS. Kevésbé kiemelt alkalmazások kommunikálnak ezekkel az alkalmazásokkal a Web Activities segítségével. Hitelesített API-ok közé tartozik: Bluetooth API, Mobile Connection API, Network Stats API, Telephony, WebSMS, WiFi Information API, Power Management API, Settings API, Idle API, Permissions API, Time/Clock API.
+
+
+ +
+

Közösség

+ +

Csatlakozz a Web API közösséghez a levelező listánkon vagy hírcsoportunkon keresztül:

+ + + +

Illetve csatlakozz az élő értekezésünkhöz a #webapi csatornán az IRC-n.

+ + + +

Ezek a témák esetlek még érdekelhetnek:

+ + +
+
+ +

 

diff --git a/files/hu/web/reference/index.html b/files/hu/web/reference/index.html new file mode 100644 index 0000000000..6d1867a6f3 --- /dev/null +++ b/files/hu/web/reference/index.html @@ -0,0 +1,28 @@ +--- +title: Web technology reference +slug: Web/Reference +tags: + - Landing + - NeedsTranslation + - Reference + - TopicStub + - Web +translation_of: Web/Reference +--- +

The open Web is built using a number of technologies. Below you'll find links to our reference material for each of them.

+ +
+
+

Core Web technologies

+ +

{{ Page ("Web", "Web technologies") }}

+
+ +
+

{{draft()}}

+ +

This page is meant to be the landing page for the "Web Platform Reference"; this would offer links to the landing pages for each of the APIs that comprise the Web platform (but would not itself have subpages).

+
+
+ +

 

diff --git a/files/hu/websockets/index.html b/files/hu/websockets/index.html new file mode 100644 index 0000000000..815c4aebb9 --- /dev/null +++ b/files/hu/websockets/index.html @@ -0,0 +1,194 @@ +--- +title: WebSockets +slug: WebSockets +tags: + - NeedsBrowserCompatibility + - NeedsTranslation + - References + - TopicStub + - WebSockets +translation_of: Web/API/WebSockets_API +--- +

WebSockets is an advanced technology that makes it possible to open an interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.

+ +
+
+

Documentation

+ +
+
Writing WebSocket client applications
+
A tutorial guide to writing WebSocket clients to run in the browser.
+
WebSockets reference
+
A reference to the client-side WebSocket API.
+
Writing WebSocket servers (Needs Content)
+
A guide to writing server-side code to handle the WebSocket protocol.
+
+ +

View All...

+
+ +
+

Tools

+ + + + + + +
+
+ +

See also

+ + + +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Version -76 support {{obsolete_inline}}6{{CompatGeckoDesktop("2.0")}}{{CompatNo}}11.00 (disabled)5.0.1
Protocol version 7 support {{obsolete_inline}}{{CompatNo}}{{CompatGeckoDesktop("6.0")}}
+ {{property_prefix("Moz")}}
{{CompatNo}}{{CompatNo}}{{CompatNo}}
Protocol version 10 support {{obsolete_inline}}14{{CompatGeckoDesktop("7.0")}}
+ {{property_prefix("Moz")}}
HTML5 Labs{{CompatUnknown}}{{CompatUnknown}}
Standard - RFC 6455 Support16{{CompatGeckoDesktop("11.0")}}1012.106.0
Usable in Workers{{CompatVersionUnknown}}{{CompatGeckoDesktop("37.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Version -76 support {{obsolete_inline}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
Protocol version 7 support {{obsolete_inline}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
Protocol version 8 support (IETF draft 10) {{obsolete_inline}}{{CompatUnknown}}{{CompatGeckoMobile("7.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
Standard - RFC 6455 Support4.4{{CompatGeckoDesktop("11.0")}}{{CompatUnknown}}12.106.0
Usable in Workers{{CompatVersionUnknown}}{{CompatGeckoMobile("37.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

Gecko notes

+ +

WebSockets support in Firefox is continuing to track the evolving WebSocket specification. Firefox 6 implements version 7 of the underlying protocol, while Firefox 7 implements version 8 (as specified by IETF draft 10). Firefox mobile received WebSocket support in Firefox mobile 7.0.

+ +

Gecko 6.0

+ +

Prior to Gecko 6.0 {{geckoRelease("6.0")}}, there was, incorrectly, a WebSocket object that some sites were thinking implied that WebSocket services were not prefixed; this object has been renamed to MozWebSocket.

+ +

Gecko 7.0

+ +

Starting in Gecko 7.0 {{geckoRelease("7.0")}}, the network.websocket.max-connections preference is used to determine the maximum number of WebSocket connections that can be open at a time. The default value is 200.

+ +

Gecko 8.0

+ +

Starting in Gecko 8.0 {{geckoRelease("8.0")}}, the deflate-stream extension to the WebSocket protocol has been disabled, since it's been deprecated from the specification drafts. This resolves incompatibilities with some sites.

+ +

Gecko 11.0

+ +

Prior to Gecko 11.0, both incoming and outgoing messages were limited to 16 MB in size. They may now be up to 2 GB in size. Note, however, that memory limitations (especially on mobile devices) make that a theoretical maximum, not a practical one. In reality, transfers of that size will fail on devices that don't have enough memory.

+ +

Additionally, ArrayBuffer send and receive support for binary data has been implemented.

+ +

Starting in Gecko 11.0, the WebSocket API is no longer prefixed.

diff --git a/files/hu/zones/index.html b/files/hu/zones/index.html new file mode 100644 index 0000000000..4fb47ab48c --- /dev/null +++ b/files/hu/zones/index.html @@ -0,0 +1,70 @@ +--- +title: Zones +slug: Zones +translation_of: Zones +--- +

MDN zónák az Ön egyablakos információkhoz való hozzáférést meghatározott témakörökben vagy termékeket. Itt egy lista az összes zóna áll az Ön rendelkezésére.

+
+
+

Web és alkalmazás fejlesztés

+
+
+ App Center
+
+ Megtanulják, hogyan kell létrehozni a nyílt webes alkalmazások gazdag tapasztalatokat, hogy halad át több eszköz és forma tényező, ugyanazt a webes szabványok és a nyílt technológiák már tudod.
+
+ Fejlesztői eszközök
+
+ Ismerje meg, hogyan kell használni a Firefox fejlesztői eszközöket, hogy hibakeresés, teszt, és optimalizálja a webes alkalmazások és a webhelyek.
+
+ Firefox Marketplace
+
+ Egy nyílt, nem védett internetes piactér webes alkalmazások HTML, CSS, JavaScript és. Küldje el az alkalmazások számára, a Firefox Marketplace, vagy használja a kódot, hogy a saját piacán.
+
+ Játék fejlesztés
+
+ Ismerje meg, hogyan lehet fejleszteni játékok az interneten, hogyan lehet a meglévő kikötő játékok webes technológiákat, és hogyan kapcsolja be a játék a webes alkalmazások.
+
+ Mozilla Developer Program
+
+ Tudjon meg többet a Mozilla Developer Program, ahol akkor iratkozzon fel a tagság a programban, iratkozzon fel hírlevelünkre, és elérheti a növekvő sor z webfejlesztőknek.
+
+
+
+

Termékek és projektek

+
+
+ Emscripten
+
+ Egy LLVM JavaScript fordító; ez lehetővé teszi, hogy lefordítani, például a C ++ kódot JavaScript kódot, amely lehet futtatni bármely webböngészőben.
+
+ L20n
+
+ A JavaScript lokalizáció keretrendszer kibontakoztatásához a természetes nyelv erejét egyszerű kódot.
+
+ A projekt MDN
+
+ A Mozilla Developer Network (ezen az oldalon) támaszkodik közössége az olvasók és a közreműködők növekedni és fejlődni. Meg lehet tanulni, hogyan kell segíteni itt, használat, hozzájárulnak, és épít a kód mögött MDN! 1
+
+ Személy
+
+ Egy új, egyszerű, magánjellegű single-megjelölés által kifejlesztett Mozilla amely lehetővé teszi a felhasználók jelentkezzen be a webhely használatával az e-mail címét, megkímélve a felhasználót jelszó kezelése.
+
+

Mozilla technológiák

+
+
+ Kiegészítőket
+
+ Megtanulják, hogyan kell építeni és telepíteni bővítményeket, témákat, és plug-inek Mozilla-alapú szoftver, köztük a népszerű Firefox böngésző.
+
+ Firefox
+
+ Tudjon meg mindent a Firefox, a hogyan építeni, és felülvizsgálja, hogyan kell építeni kiegészítőket kifejezetten azt.
+
+ Firefox OS
+
+ Az új mobil operációs rendszer által kifejlesztett Mozilla amely lehetővé teszi a felhasználók telepíteni és futtatni a nyílt webes alkalmazások segítségével létrehozott HTML, CSS, JavaScript és.
+
+
+
+

 

-- cgit v1.2.3-54-g00ecf