From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/pl/web/api/document/activeelement/index.html | 26 ++ files/pl/web/api/document/alinkcolor/index.html | 24 ++ files/pl/web/api/document/anchors/index.html | 38 +++ files/pl/web/api/document/applets/index.html | 26 ++ files/pl/web/api/document/bgcolor/index.html | 33 ++ files/pl/web/api/document/body/index.html | 31 ++ files/pl/web/api/document/characterset/index.html | 26 ++ files/pl/web/api/document/clear/index.html | 19 ++ files/pl/web/api/document/close/index.html | 26 ++ files/pl/web/api/document/compatmode/index.html | 32 ++ files/pl/web/api/document/cookie/index.html | 49 +++ .../pl/web/api/document/createattribute/index.html | 29 ++ .../api/document/createdocumentfragment/index.html | 43 +++ files/pl/web/api/document/createelement/index.html | 74 +++++ files/pl/web/api/document/createevent/index.html | 134 +++++++++ files/pl/web/api/document/createrange/index.html | 29 ++ .../pl/web/api/document/createtextnode/index.html | 62 ++++ files/pl/web/api/document/defaultview/index.html | 24 ++ files/pl/web/api/document/designmode/index.html | 53 ++++ files/pl/web/api/document/doctype/index.html | 21 ++ .../pl/web/api/document/documentelement/index.html | 60 ++++ files/pl/web/api/document/domain/index.html | 30 ++ files/pl/web/api/document/drag_event/index.html | 333 +++++++++++++++++++++ files/pl/web/api/document/embeds/index.html | 22 ++ files/pl/web/api/document/execcommand/index.html | 280 +++++++++++++++++ files/pl/web/api/document/fgcolor/index.html | 28 ++ files/pl/web/api/document/firstchild/index.html | 36 +++ files/pl/web/api/document/forms/index.html | 45 +++ .../pl/web/api/document/getelementbyid/index.html | 67 +++++ .../api/document/getelementsbyclassname/index.html | 82 +++++ .../web/api/document/getelementsbyname/index.html | 35 +++ .../api/document/getelementsbytagname/index.html | 108 +++++++ files/pl/web/api/document/hasfocus/index.html | 25 ++ files/pl/web/api/document/head/index.html | 110 +++++++ files/pl/web/api/document/height/index.html | 34 +++ files/pl/web/api/document/images/index.html | 31 ++ .../pl/web/api/document/implementation/index.html | 21 ++ files/pl/web/api/document/importnode/index.html | 57 ++++ files/pl/web/api/document/index.html | 332 ++++++++++++++++++++ files/pl/web/api/document/lastmodified/index.html | 25 ++ files/pl/web/api/document/linkcolor/index.html | 33 ++ files/pl/web/api/document/links/index.html | 30 ++ files/pl/web/api/document/location/index.html | 37 +++ files/pl/web/api/document/namespaceuri/index.html | 25 ++ files/pl/web/api/document/open/index.html | 40 +++ files/pl/web/api/document/plugins/index.html | 40 +++ files/pl/web/api/document/queryselector/index.html | 159 ++++++++++ files/pl/web/api/document/referrer/index.html | 22 ++ .../pl/web/api/document/releasecapture/index.html | 31 ++ files/pl/web/api/document/stylesheets/index.html | 19 ++ files/pl/web/api/document/title/index.html | 45 +++ files/pl/web/api/document/url/index.html | 25 ++ files/pl/web/api/document/vlinkcolor/index.html | 29 ++ files/pl/web/api/document/width/index.html | 28 ++ files/pl/web/api/document/write/index.html | 38 +++ files/pl/web/api/document/writeln/index.html | 41 +++ 56 files changed, 3202 insertions(+) create mode 100644 files/pl/web/api/document/activeelement/index.html create mode 100644 files/pl/web/api/document/alinkcolor/index.html create mode 100644 files/pl/web/api/document/anchors/index.html create mode 100644 files/pl/web/api/document/applets/index.html create mode 100644 files/pl/web/api/document/bgcolor/index.html create mode 100644 files/pl/web/api/document/body/index.html create mode 100644 files/pl/web/api/document/characterset/index.html create mode 100644 files/pl/web/api/document/clear/index.html create mode 100644 files/pl/web/api/document/close/index.html create mode 100644 files/pl/web/api/document/compatmode/index.html create mode 100644 files/pl/web/api/document/cookie/index.html create mode 100644 files/pl/web/api/document/createattribute/index.html create mode 100644 files/pl/web/api/document/createdocumentfragment/index.html create mode 100644 files/pl/web/api/document/createelement/index.html create mode 100644 files/pl/web/api/document/createevent/index.html create mode 100644 files/pl/web/api/document/createrange/index.html create mode 100644 files/pl/web/api/document/createtextnode/index.html create mode 100644 files/pl/web/api/document/defaultview/index.html create mode 100644 files/pl/web/api/document/designmode/index.html create mode 100644 files/pl/web/api/document/doctype/index.html create mode 100644 files/pl/web/api/document/documentelement/index.html create mode 100644 files/pl/web/api/document/domain/index.html create mode 100644 files/pl/web/api/document/drag_event/index.html create mode 100644 files/pl/web/api/document/embeds/index.html create mode 100644 files/pl/web/api/document/execcommand/index.html create mode 100644 files/pl/web/api/document/fgcolor/index.html create mode 100644 files/pl/web/api/document/firstchild/index.html create mode 100644 files/pl/web/api/document/forms/index.html create mode 100644 files/pl/web/api/document/getelementbyid/index.html create mode 100644 files/pl/web/api/document/getelementsbyclassname/index.html create mode 100644 files/pl/web/api/document/getelementsbyname/index.html create mode 100644 files/pl/web/api/document/getelementsbytagname/index.html create mode 100644 files/pl/web/api/document/hasfocus/index.html create mode 100644 files/pl/web/api/document/head/index.html create mode 100644 files/pl/web/api/document/height/index.html create mode 100644 files/pl/web/api/document/images/index.html create mode 100644 files/pl/web/api/document/implementation/index.html create mode 100644 files/pl/web/api/document/importnode/index.html create mode 100644 files/pl/web/api/document/index.html create mode 100644 files/pl/web/api/document/lastmodified/index.html create mode 100644 files/pl/web/api/document/linkcolor/index.html create mode 100644 files/pl/web/api/document/links/index.html create mode 100644 files/pl/web/api/document/location/index.html create mode 100644 files/pl/web/api/document/namespaceuri/index.html create mode 100644 files/pl/web/api/document/open/index.html create mode 100644 files/pl/web/api/document/plugins/index.html create mode 100644 files/pl/web/api/document/queryselector/index.html create mode 100644 files/pl/web/api/document/referrer/index.html create mode 100644 files/pl/web/api/document/releasecapture/index.html create mode 100644 files/pl/web/api/document/stylesheets/index.html create mode 100644 files/pl/web/api/document/title/index.html create mode 100644 files/pl/web/api/document/url/index.html create mode 100644 files/pl/web/api/document/vlinkcolor/index.html create mode 100644 files/pl/web/api/document/width/index.html create mode 100644 files/pl/web/api/document/write/index.html create mode 100644 files/pl/web/api/document/writeln/index.html (limited to 'files/pl/web/api/document') diff --git a/files/pl/web/api/document/activeelement/index.html b/files/pl/web/api/document/activeelement/index.html new file mode 100644 index 0000000000..bd8527e319 --- /dev/null +++ b/files/pl/web/api/document/activeelement/index.html @@ -0,0 +1,26 @@ +--- +title: document.activeElement +slug: Web/API/Document/activeElement +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/DocumentOrShadowRoot/activeElement +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca element, na którym ustawiony jest fokus.

+

{{ Note("Ten atrybut jest częścią specyfikacji HTML 5, która jest wciąż opracowywana.") }}

+

Składnia

+
var curElement = document.activeElement;
+
+

Przykład

+

Specyfikacja

+

Zarządzanie fokusem

+

 

+

 

+

 

+
+  
+

{{ languages( { "en": "en/DOM/document.activeElement", "es": "es/DOM/element.activeElement", "fr": "fr/DOM/document.activeElement", "ja": "ja/DOM/document.activeElement" } ) }}

diff --git a/files/pl/web/api/document/alinkcolor/index.html b/files/pl/web/api/document/alinkcolor/index.html new file mode 100644 index 0000000000..82e8dda6cd --- /dev/null +++ b/files/pl/web/api/document/alinkcolor/index.html @@ -0,0 +1,24 @@ +--- +title: document.alinkColor +slug: Web/API/Document/alinkColor +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/alinkColor +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca bądź ustawia kolor aktywnych odnośników w ciele dokumentu.

+

Składnia

+
kolor = HTMLBodyElement.aLinkColor
+HTMLBodyElement.aLinkColor =kolor
+
+

Parametry

+ +

Specyfikacja

+

DOM Level 0 - brak w specyfikacji.

+

{{ languages( { "en": "en/DOM/document.alinkColor", "es": "es/DOM/document.alinkColor" } ) }}

diff --git a/files/pl/web/api/document/anchors/index.html b/files/pl/web/api/document/anchors/index.html new file mode 100644 index 0000000000..e1681f5372 --- /dev/null +++ b/files/pl/web/api/document/anchors/index.html @@ -0,0 +1,38 @@ +--- +title: document.anchors +slug: Web/API/Document/anchors +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/anchors +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

anchors zwraca listę wszystkich kotwic w dokumencie.

+ +

Składnia

+ +
listaWęzłów = document.anchors
+
+ +

Przykład

+ +
if ( document.anchors.length >= 5 ) {
+    dump("dump found too many anchors");
+    window.location = "http://www.google.com";
+}
+
+ +

Uwagi

+ +

Ze względu na zgodność wsteczną, zwracany zestaw kotwic zawiera tylko kotwice posiadające atrybut name, bez tych które posiadają jedynie atrybut id.

+ +

Specyfikacja

+ +

DOM Level 2 HTML: anchors

+ +

{{ languages( { "en": "en/DOM/document.anchors", "es": "es/DOM/document.anchors", "ja": "ja/DOM/document.anchors" } ) }}

diff --git a/files/pl/web/api/document/applets/index.html b/files/pl/web/api/document/applets/index.html new file mode 100644 index 0000000000..719c43b33b --- /dev/null +++ b/files/pl/web/api/document/applets/index.html @@ -0,0 +1,26 @@ +--- +title: document.applets +slug: Web/API/Document/applets +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/applets +--- +

{{ ApiRef() }}

+

Podsumowanie

+

applets zwraca uporządkowaną listę apletów umieszczonych w dokumencie.

+

Składnia

+
listaWęzłów = document.applets
+
+

Przykład

+
// (Kiedy wiesz, że drugi aplet jest tym,
+// którego szukasz)
+my_java_app = document.applets[1];
+
+

Specyfikacja

+

applets

+
+  
+

{{ languages( { "en": "en/DOM/document.applets", "es": "es/DOM/document.applets" } ) }}

diff --git a/files/pl/web/api/document/bgcolor/index.html b/files/pl/web/api/document/bgcolor/index.html new file mode 100644 index 0000000000..cdc5731cbf --- /dev/null +++ b/files/pl/web/api/document/bgcolor/index.html @@ -0,0 +1,33 @@ +--- +title: document.bgColor +slug: Web/API/Document/bgColor +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/bgColor +--- +

{{ ApiRef() }}

+

Podsumowanie

+

{{ Deprecated_header() }} Własność + + bgColor + pobiera/zwraca kolor tła dokumentu.

+

Składnia

+
kolor = document.bgColor
+document.bgColor =kolor
+
+

Parametry

+ +

Przykład

+
document.bgColor = "darkblue";
+
+

Notes

+

Domyślną wartością tej własności w Mozilli Firefox jest kolor biały (#ffffff w systemie szesnastkowym).

+

Własność document.bgColor jest wycofywana DOM Level 2 HTML. Zalecanym rozwiązaniem alternatywnym jest użycie stylu CSS background-color, gdy możemy uzyskać dostęp bezpośrednio przez DOM za pomocą własnościdocument.body.style.backgroundColor. Innym alternatywnym rozwiązaniem jest document.body.bgColor, chociaż to rozwiązanie jest także wycofywane w HTML 4.01 na rzecz rozwiązania wykorzystującego CSS .

+

Specyfikacja

+

DOM Level 0 - brak w specyfikacji.

+

{{ languages( { "en": "en/DOM/document.bgColor", "es": "es/DOM/document.bgColor" } ) }}

diff --git a/files/pl/web/api/document/body/index.html b/files/pl/web/api/document/body/index.html new file mode 100644 index 0000000000..1ae1aa480e --- /dev/null +++ b/files/pl/web/api/document/body/index.html @@ -0,0 +1,31 @@ +--- +title: document.body +slug: Web/API/Document/body +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/body +--- +

{{ ApiRef() }}

+

Podsumowanie

+

body zwraca węzeł <body> lub <frameset> z bieżącego dokumentu.

+

Składnia

+
objRef = document.body
+document.body =objRef
+
+

Przykład

+
// HTML: <body id="oldBodyElement"></body>
+alert(document.body.id); // "oldBodyElement"
+var aNewBodyElement = document.createElement("body");
+aNewBodyElement.id = "newBodyElement";
+document.body = aNewBodyElement;
+alert(document.body.id); // "newBodyElement"
+
+

Uwagi

+

document.body to element zawierający treść dokumentu. W dokumentach z elementem <body> własność zwraca tenże element, w dokumentach z definicją ramek zwracany jest najbardziej zewnętrzny element <frameset>.

+

Mimo, że body można samemu ustawić, jego zmiana spowoduje skuteczne usunięcie wszystkich potomków istniejącego elementu <body>.

+

Specyfikacja

+

body

+

{{ languages( { "en": "en/DOM/document.body", "es": "es/DOM/document.body" } ) }}

diff --git a/files/pl/web/api/document/characterset/index.html b/files/pl/web/api/document/characterset/index.html new file mode 100644 index 0000000000..4d7fa83359 --- /dev/null +++ b/files/pl/web/api/document/characterset/index.html @@ -0,0 +1,26 @@ +--- +title: document.characterSet +slug: Web/API/Document/characterSet +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/characterSet +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca kodowanie znaków dokumentu.

+

Składnia

+
ciąg = document.characterSet
+
+

Przykład

+
<button onclick="alert(document.characterSet);">Pokaż kodowanie znaków</button>
+// zwraca kodowanie znaków dokumentu, takie jak "ISO-8859-1 lub UTF-8"
+
+

Uwagi

+

Jest to zestaw znaków użyty przy renderowaniu strony, niekoniecznie taki, jak zadeklarowany w kodzie strony (użytkownik może narzucić własne kodowanie).

+

Kompletną listę dostępnych zestawów znaków znajdziesz tu: http://www.iana.org/assignments/character-sets.

+

Specyfikacja

+

DOM Level 0 - brak w specyfikacji.

+

{{ languages( { "en": "en/DOM/document.characterSet", "es": "es/DOM/document.characterSet" } ) }}

diff --git a/files/pl/web/api/document/clear/index.html b/files/pl/web/api/document/clear/index.html new file mode 100644 index 0000000000..fdeaf2e52e --- /dev/null +++ b/files/pl/web/api/document/clear/index.html @@ -0,0 +1,19 @@ +--- +title: document.clear +slug: Web/API/Document/clear +tags: + - DOM + - Wszystkie_kategorie +translation_of: Web/API/Document/clear +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Metoda clear czyści dokument, usuwając całą jego zawartość.

+

Składnia

+
document.clear()
+
+

Przykład

+
<button label="empty" onclick="document.clear();" />
+
+

Specyfikacja

+

DOM Level 0 - brak w specyfikacji.

diff --git a/files/pl/web/api/document/close/index.html b/files/pl/web/api/document/close/index.html new file mode 100644 index 0000000000..b325beb8cc --- /dev/null +++ b/files/pl/web/api/document/close/index.html @@ -0,0 +1,26 @@ +--- +title: document.close +slug: Web/API/Document/close +tags: + - DOM + - Wszystkie_kategorie +translation_of: Web/API/Document/close +--- +
+ {{APIRef}}
+
+  
+

Podsumowanie

+

Metoda document.close() kończy zapis do otwartego dokumentu.

+

Składnia

+
document.close()
+
+

Przykład

+
// otwieramy dokument do zapisu
+// i kończymy zamknięciem poprzez close()
+document.open();
+document.write("<P>The only content</P>.");
+document.close();
+
+

Specyfikacja

+

close

diff --git a/files/pl/web/api/document/compatmode/index.html b/files/pl/web/api/document/compatmode/index.html new file mode 100644 index 0000000000..a2750f2ad8 --- /dev/null +++ b/files/pl/web/api/document/compatmode/index.html @@ -0,0 +1,32 @@ +--- +title: document.compatMode +slug: Web/API/Document/compatMode +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/compatMode +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Wskazuje, czy dokument renderowany jest w trybie zgodności wstecznej (ang. + + quirks mode + ), czy też w trybie standardów (ang. + + strict mode + ).

+

Składnia

+
tryb = document.compatMode
+
+

Parametry

+ +

Przykład

+
if ( document.compatMode == "BackCompat" ){
+  //wykonaj coś dla trybu zgodności
+}
+
+

{{ languages( { "en": "en/DOM/document.compatMode" } ) }}

diff --git a/files/pl/web/api/document/cookie/index.html b/files/pl/web/api/document/cookie/index.html new file mode 100644 index 0000000000..a711e9c1d2 --- /dev/null +++ b/files/pl/web/api/document/cookie/index.html @@ -0,0 +1,49 @@ +--- +title: document.cookie +slug: Web/API/Document/cookie +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/cookie +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Pobiera/ustawia listę ciasteczek powiązanych z dokumentem.

+ +

Składnia

+ +
listaCiasteczek = document.cookie
+document.cookie = listaCiasteczek
+
+ +

Parametry

+ + + +

Przykład

+ +
// ta funkcja ustawia dwa ciasteczka
+// a następnie wyświetla je w ostrzeżeniu
+function sgCookie() {
+  document.cookie = "name=oeschger";
+  document.cookie = "favorite_food=tripe";
+  alert(document.cookie);
+}
+// wyświetli: name=oeschger;favorite_food=tripe
+
+ +

Uwagi

+ +

Jeżeli nie ma ciasteczek powiązanych z tym dokumentem, funkcja zwraca pusty ciąg. Zauważ również, że nie możesz użyć tej własności, bu ustawić więcej niż jedno ciasteczko za jednym razem.

+ +

Specyfikacja

+ +

cookie

+ +

{{ languages( { "en": "en/DOM/document.cookie", "es": "es/DOM/document.cookie" } ) }}

diff --git a/files/pl/web/api/document/createattribute/index.html b/files/pl/web/api/document/createattribute/index.html new file mode 100644 index 0000000000..ad996d5161 --- /dev/null +++ b/files/pl/web/api/document/createattribute/index.html @@ -0,0 +1,29 @@ +--- +title: document.createAttribute +slug: Web/API/Document/createAttribute +tags: + - DOM + - Wszystkie_kategorie +translation_of: Web/API/Document/createAttribute +--- +

{{ ApiRef() }}

+

Podsumowanie

+

createAttribute tworzy nowy atrybut w bieżącym elemencie.

+

Składnia

+
atrybut = element.createAttribute(nazwa)
+
+

Parametry

+ +

Przykład

+
d = document.getElementById("div1");
+p = d.createAttribute("proportion");
+p.value = "100";
+
+

Uwagi

+

Zwracany jest węzeł typu Attribute. Kiedy masz już ten węzeł, tak jak w powyzszym przykładzie, możesz ustawić jego wartość za pomocą własności value. DOM nie wymusza typu atrybutów, jakie mogą zostać dodane w ten sposób do konkretnych elementów.

+

Specyfikacja

+

createAttribute

+

{{ languages( { "en": "en/DOM/document.createAttribute", "fr": "fr/DOM/document.createAttribute" } ) }}

diff --git a/files/pl/web/api/document/createdocumentfragment/index.html b/files/pl/web/api/document/createdocumentfragment/index.html new file mode 100644 index 0000000000..e6bf6e6da3 --- /dev/null +++ b/files/pl/web/api/document/createdocumentfragment/index.html @@ -0,0 +1,43 @@ +--- +title: document.createDocumentFragment +slug: Web/API/Document/createDocumentFragment +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/createDocumentFragment +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Tworzy pusty fragment dokumentu.

+ +

Składnia

+ +
var fragmentDokumentu = document.createDocumentFragment();
+
+ +

fragmentDokumentu jest odniesieniem do pustego obiektu DocumentFragment.

+ +

Przykład

+ +
var frag = document.createDocumentFragment();
+frag.appendChild(document.createTextNode('Ipsum Lorem'));
+document.body.appendChild(frag);
+
+ +

Uwagi

+ +

DocumentFragment jest minimalnym obiektem dokumentu, który nie posiada rodzica. Obsługuje on następujące metody DOM 2: appendChild, cloneNode, hasAttributes, hasChildNodes, insertBefore, normalize, removeChild, replaceChild.

+ +

Obsługuje on również następujące własności DOM 2: attributes, childNodes, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, textContent.

+ +

Różne inne metody potrafią pobrać fragment dokumentu jako argument (na przykład metody interfejsu Node takie jak appendChild i insertBefore), w przypadku których dodawane lub wstawiane są dzieci fragmentu, nie zaś same fragmenty.

+ +

Specyfikacja

+ +

createDocumentFragment

+ +

{{ languages( { "en": "en/DOM/document.createDocumentFragment" } ) }}

diff --git a/files/pl/web/api/document/createelement/index.html b/files/pl/web/api/document/createelement/index.html new file mode 100644 index 0000000000..bf657b4103 --- /dev/null +++ b/files/pl/web/api/document/createelement/index.html @@ -0,0 +1,74 @@ +--- +title: document.createElement +slug: Web/API/Document/createElement +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/createElement +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Tworzy element podanego typu. Zauważ, że zwracana instancja implementuje interfejs Element, zatem można manipulować atrybutami bezpośrednio na zwróconym obiekcie.

+ +

Składnia

+ +
''element'' = document.createElement(''typ'')
+
+ +

Parametry

+ + + +

Przykład

+ +
<html>
+<head>
+<title>||Praca z elementami||</title>
+</head>
+
+<script type="text/javascript">
+var my_div = null;
+var newDiv = null;
+
+function addElement()
+{
+  // tworzy nowy element div
+  // i daje jego zawartość
+  newDiv = document.createElement("div");
+  newDiv.innerHTML = "<h1>Hi there and greetings!</h1>";
+
+  // add the newly created element and it's content into the DOM
+  my_div = document.getElementById("org_div1");
+  document.body.insertBefore(newDiv, my_div);
+}
+
+</script>
+
+<body onload="addElement()">
+    <div id='org_div1'> The text above has been created dynamically.</div>
+</body>
+</html>
+
+ +

Uwagi

+ +

Jeżeli znane są atrybuty o domyślnych wartościach, zostaną automatycznie utworzone i przypisane do elementu węzły tychże atrybutów.

+ +

Aby utworzyć element o uściślonej nazwie i URI przestrzeni nazw, użyj metody createElementNS.

+ +

Specyfikacja

+ +

createElement

+ + + +
+ +

{{ languages( { "en": "en/DOM/document.createElement", "fr": "fr/DOM/document.createElement", "it": "it/DOM/document.createElement", "ja": "ja/DOM/document.createElement", "ko": "ko/DOM/document.createElement" } ) }}

diff --git a/files/pl/web/api/document/createevent/index.html b/files/pl/web/api/document/createevent/index.html new file mode 100644 index 0000000000..1064131504 --- /dev/null +++ b/files/pl/web/api/document/createevent/index.html @@ -0,0 +1,134 @@ +--- +title: document.createEvent +slug: Web/API/Document/createEvent +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/createEvent +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Tworzy obiekt obsługi zdarzenia o określonym typie. Utworzony obiekt powinien zostać najpierw zainicjalizowany, a następnie przekazany do metody dispatchEvent elementu.

+

Składnia

+
var zdarzenie =document.createEvent(typ);
+
+ +

Przykład

+

dispatchEvent - przykład [pl]

+

Uwagi

+

Nazwy typów zdarzeń, które można przekazać do createEvent określane są przez + + moduły zdarzeń + . Niektóre moduły zdarzeń zdefiniowane są w specyfikacjach DOM Events, niektóre moduły w innych specyfikacjach (jak np. SVG), a pewne typy zdarzeń są specyficzne dla Gecko.

+

Szczegóły znajdziesz w poniższej tabeli.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Moduł zdarzeńTyp do przekazania w createEventMetoda używana do inicjalizacji zdarzenia
DOM Level 2 Events
Moduł zdarzeń interfejsu użytkownika"UIEvents"event.initUIEvent
Moduł zdarzeń myszy"MouseEvents"event.initMouseEvent
Moduł zdarzeń mutacji"MutationEvents"event.initMutationEvent
Moduł zdarzeń HTML"HTMLEvents"event.initEvent
DOM Level 3 Events
Moduł zdarzeń interfejsu użytkownika"UIEvent", "UIEvents"event.initUIEvent
Moduł zdarzeń myszy"MouseEvent", "MouseEvents"event.initMouseEvent
Moduł zdarzeń mutacji"MutationEvent", "MutationEvents"event.initMutationEvent
Moduł zdarzeń mutacji nazw (nie zaimplementowany przez Gecko - czerwiec 2006)"MutationNameEvent"event.initMutationNameEvent
Moduł zdarzeń tekstowych"TextEvent" (Gecko obsługuje też "TextEvents")event.initTextEvent
Moduł zdarzeń klawiatury"KeyboardEvent" (Gecko obsługuje też "KeyEvents")event.initKeyboardEvent
Moduł podstawowych zdarzeń"Event" (Gecko obsługuje też "Events")event.initEvent
SVG 1.1 Scripting
SVG"SVGEvents" (Gecko obsługuje też "SVGEvent")event.initEvent
"SVGZoomEvents" (Gecko obsługuje też "SVGZoomEvent")event.initUIEvent
Inne typy zdarzeń obsługiwane przez Gecko Gecko-related information is taken from nsEventDispatcher::CreateEvent code - see lxr.m.o
-"MouseScrollEvents", "PopupEvents"event.initMouseEvent
"PopupBlockedEvents"event.initPopupBlockedEvent
"XULCommandEvent", "XULCommandEvents"event.initCommandEvent
+

Niektóre zdarzenia mogą być tworzone przy użyciu dwóch nazw typów, ponieważ w specyfikacji DOM Level 3 Events zmieniono nazwy z liczby mnogiej na pojedynczą, pozostawiając nazwy w liczbie mnogiej dla zgodności wstecznej.

+

Specyfikacja

+

DOM Level 2 Events: createEvent

+

DOM Level 3 Events: createEvent

+

 

+
+  
+

{{ languages( { "en": "en/DOM/document.createEvent", "es": "es/DOM/document.createEvent", "ja": "ja/DOM/document.createEvent" } ) }}

diff --git a/files/pl/web/api/document/createrange/index.html b/files/pl/web/api/document/createrange/index.html new file mode 100644 index 0000000000..75dbacfe83 --- /dev/null +++ b/files/pl/web/api/document/createrange/index.html @@ -0,0 +1,29 @@ +--- +title: document.createRange +slug: Web/API/Document/createRange +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/createRange +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca nowy objekt Range.

+

Składnia

+
range = document.createRange();
+
+

range jest utworzonym objektem range.

+

Przykład

+
var range = document.createRange();
+range.setStart(startNode, startOffset);
+range.setEnd(endNode, endOffset);
+
+

Uwagi

+

Gdy tylko Range jest utworzony, musisz określić jego punkty graniczne zanim będziesz mógł użyć większości jego metod.

+

Specyfikacja

+

DOM Level 2 Range: DocumentRange.createRange

+
+  
+

{{ languages( { "en": "en/DOM/document.createRange", "es": "es/DOM/document.createRange" } ) }}

diff --git a/files/pl/web/api/document/createtextnode/index.html b/files/pl/web/api/document/createtextnode/index.html new file mode 100644 index 0000000000..1fe0f9bd27 --- /dev/null +++ b/files/pl/web/api/document/createtextnode/index.html @@ -0,0 +1,62 @@ +--- +title: document.createTextNode +slug: Web/API/Document/createTextNode +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/createTextNode +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Tworzy nowy węzeł tekstowy.

+ +

Składnia

+ +
var tekst = document.createTextNode(tresc)
+
+ +

Parametry

+ + + +

Przykład

+ +
<!DOCTYPE html>
+<html lang="en">
+<head>
+<title>createTextNode - przyklad</title>
+<script>
+function dodajWezelTekstowy(tekst) {
+  var nowytekst = document.createTextNode(tekst),
+      p1 = document.getElementById("p1");
+
+  p1.appendChild(nowytekst);
+}
+</script>
+</head>
+
+<body>
+  <button onclick="dodajWezelTekstowy('TAK! ');">TAK!</button>
+  <button onclick="dodajWezelTekstowy('NIE! ');">NIE!</button>
+  <button onclick="dodajWezelTekstowy('JASNE! ');">JASNE!</button>
+
+  <hr />
+
+  <p id="p1">Pierwsza linia paragrafu.</p>
+</body>
+</html>
+ +

Specyfikacja

+ +

createTextNode

+ +
 
+ +

{{ languages( { "en": "en/DOM/document.createTextNode", "fr": "fr/DOM/document.createTextNode", "ko": "ko/DOM/document.createTextNode" } ) }}

diff --git a/files/pl/web/api/document/defaultview/index.html b/files/pl/web/api/document/defaultview/index.html new file mode 100644 index 0000000000..905a966998 --- /dev/null +++ b/files/pl/web/api/document/defaultview/index.html @@ -0,0 +1,24 @@ +--- +title: document.defaultView +slug: Web/API/Document/defaultView +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/defaultView +--- +

{{ ApiRef() }}

+

 

+

Podsumowanie

+

document.defaultView zwraca odnośnik do domyślnego AbstractView dokumentu, lub null jeśli żadny nie jest dostępne

+

Składnia

+
var docDView = document.defaultView;
+
+

Własność tylko do odczytu.

+

Uwagi

+

document.defaultView jest częścią interfejsu DOM poziomu 2 DocumentView.

+

document.defaultView jest głównie odnośnikiem do okna obiektu dla dokumentu, jednakże nie jest to zdefiniowane w specyfikacji i nie można się na tym opierać we wszystkich środowiskach zwłaszcza, że nie wszystkie przeglądarki to implementują. it would probably be useful to provide concrete examples here

+

Specyfikacja

+

DOM Level 2 Views: defaultView

+

{{ languages( { "en": "en/DOM/document.defaultView" } ) }}

diff --git a/files/pl/web/api/document/designmode/index.html b/files/pl/web/api/document/designmode/index.html new file mode 100644 index 0000000000..3956fa8d9e --- /dev/null +++ b/files/pl/web/api/document/designmode/index.html @@ -0,0 +1,53 @@ +--- +title: Document.designMode +slug: Web/API/Document/designMode +translation_of: Web/API/Document/designMode +--- +
{{ApiRef()}}
+ +

document.designMode kontroluje czy dokument może być edytowany. Dopuszczalne wartości to "on" (włączona edycja) oraz "off" (wyłączona edycja). Zgodnie ze specyfikacją, wartość domyślna to "off". Firefox stosuje ten standard. Dla wcześniejszych wersji Chrome oraz IE domyślną wartością było "inherit". Od wersji Chrome 43, standardem jest wartość "off", a "inherit" nie jest wspierane. W IE 6-10, wartość jest używana naprzemiennie.

+ +

Składnia

+ +
var mode = document.designMode;
+document.designMode = "on" || "off";
+ +

Przykład

+ +

Spraw aby element {{HTMLElement("iframe")}} był edytowalny:

+ +
iframeNode.contentDocument.designMode = "on";
+
+ +

Specyfikacje

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#making-entire-documents-editable:-the-designmode-idl-attribute', 'designMode')}}{{Spec2('HTML WHATWG')}}Definicja
+ +

Kompatybilność przeglądarek

+ + + +

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

+ +

Zobacz również

+ + diff --git a/files/pl/web/api/document/doctype/index.html b/files/pl/web/api/document/doctype/index.html new file mode 100644 index 0000000000..4894005b15 --- /dev/null +++ b/files/pl/web/api/document/doctype/index.html @@ -0,0 +1,21 @@ +--- +title: document.doctype +slug: Web/API/Document/doctype +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/doctype +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca definicję typu bieżącego dokumentu (DTD).

+

Składnia

+
ciąg = document.doctype
+
+

Uwagi

+

Atrybut doctype jest tylko do odczytu. Jeżeli nie ma DTD w dokumencie, zwrócone zostaje NULL.

+

Specyfikacja

+

docType

+

{{ languages( { "en": "en/DOM/document.doctype" } ) }}

diff --git a/files/pl/web/api/document/documentelement/index.html b/files/pl/web/api/document/documentelement/index.html new file mode 100644 index 0000000000..bc729c829f --- /dev/null +++ b/files/pl/web/api/document/documentelement/index.html @@ -0,0 +1,60 @@ +--- +title: document.documentElement +slug: Web/API/Document/documentElement +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/documentElement +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Tylko do odczytu

+ +

Zwraca Element będący bezpośrednim dzieckiem document (na przykład dla dokumentów HTML jest to element <html>).

+ +

Składnia

+ +
varelement = document.documentElement;
+
+ +

Przykład

+ +
actual_doc = document.documentElement;
+first_tier = actual_doc.childNodes;
+//first_tier to bezpośrednie dzieci HTML
+for (var i = 0; i < first_tier.length; i++) {
+   //zrób cos z każdym dzieckiem HTML
+   //poprzez first_tier[i]
+}
+
+ +
var rootElement = document.documentElement;
+var firstTier = rootElement.childNodes;
+// firstTier jest NodeList bezpośredniego dziecka elementu głównego
+for (var i = 0; i < firstTier.length; i++) {
+   // zrób coś z każdym dzieckiem HTML głównego elementu
+   // as firstTier[i]
+}
+
+ +

Uwagi

+ +

Ta własność tylko do odczytu jest udogodnieniem w przechwytywaniu elementu HTML, powiązanego z każdym prawidłowym dokumentem HTML.

+ +

Powyżej typowy przykład: potrzebujesz w rzeczywistości elementu HTML, aby mieć dostęp do wszystkich jego dzieci, więc używasz tej własności obiektu document, aby go przejąć.

+ +

Zauważ też, że zazwyczaj document zawiera jeden węzeł-dziecko - HTML - który sam zawiera wszystkie elementy faktycznego dokumentu jako listę węzłów-dzieci (nodeList).

+ +

Specyfikacja

+ +

DOM Level 2 Core: Document.documentElement

+ + + +
+ +

{{ languages( { "en": "en/DOM/document.documentElement", "es": "es/DOM/document.documentElement", "fr": "fr/DOM/document.documentElement", "ja": "ja/DOM/document.documentElement" } ) }}

diff --git a/files/pl/web/api/document/domain/index.html b/files/pl/web/api/document/domain/index.html new file mode 100644 index 0000000000..e64ad2e641 --- /dev/null +++ b/files/pl/web/api/document/domain/index.html @@ -0,0 +1,30 @@ +--- +title: document.domain +slug: Web/API/Document/domain +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/domain +--- +

{{ ApiRef() }}

+

Podsumowanie

+

domain pobiera/ustawia domenę bieżącego dokumentu.

+

Składnia

+
ciąg = document.domain
+document.domain =ciąg
+
+

Przykład

+
bad_domain = "www.love.com";
+if ( document.domain == bad_domain ) {
+   window.close();
+}
+// jeśli dokument to www.love.com/good.html,
+// to skrypt zamknie okno
+
+

Uwagi

+

Właściwość zwraca NULL jezeli nie można zidentyfikować serwera. W specyfikacji DOM własność tą oznaczono jako tylko do oczytu, jednak Mozilla pozwala na jej modyfikację.

+

Specyfikacja

+

domain

+

{{ languages( { "en": "en/DOM/document.domain" } ) }}

diff --git a/files/pl/web/api/document/drag_event/index.html b/files/pl/web/api/document/drag_event/index.html new file mode 100644 index 0000000000..ccc5d55cbb --- /dev/null +++ b/files/pl/web/api/document/drag_event/index.html @@ -0,0 +1,333 @@ +--- +title: drag +slug: Web/API/Document/drag_event +tags: + - DOM + - Zdarzenie + - przeciągnij i upuść +translation_of: Web/API/Document/drag_event +--- +
{{APIRef}}
+ +

Zdarzenie przeciągania uruchamiane jest po przeciągnięciu elementu lub tekstu (co kilkaset milisekund).

+ +

Ogólne informacje

+ + + + + + + + + + + + + + + + + + + + + + + + +
BąbelkowanieTak
CancelableTak
Obiekt docelowy{{domxref("Document")}}, {{domxref("Element")}}
Interfejs{{domxref("DragEvent")}}
Domyślna akcjaKontynuuje operacje przeciągania i upuszczania
+ +

Właściwości

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
target {{readonlyInline}}EventTargetThe element that was underneath the element being dragged.
type {{readonlyInline}}DOMStringThe type of event.
bubbles {{readonlyInline}}BooleanWhether the event normally bubbles or not
cancelable {{readonlyInline}}BooleanWhether the event is cancellable or not?
view {{readonlyInline}}WindowProxydocument.defaultView (window of the document)
detail {{readonlyInline}}long (float)0.
dataTransferDataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. Protected mode.
currentTarget {{readonlyInline}}EventTargetThe node that had the event listener attached.
relatedTarget {{readonlyInline}}EventTargetFor mouseover, mouseout, mouseenter and mouseleave events: the target of the complementary event (the mouseleave target in the case of a mouseenter event). null otherwise.
screenX {{readonlyInline}}longThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY {{readonlyInline}}longThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX {{readonlyInline}}longThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY {{readonlyInline}}longThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
button {{readonlyInline}}unsigned shortThe button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.
buttons {{readonlyInline}}unsigned shortThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2). More info.
mozPressure {{readonlyInline}}floatThe amount of pressure applied to a touch or tabdevice when generating the event; this value ranges between 0.0 (minimum pressure) and 1.0 (maximum pressure).
ctrlKey {{readonlyInline}}booleantrue if the control key was down when the event was fired. false otherwise.
shiftKey {{readonlyInline}}booleantrue if the shift key was down when the event was fired. false otherwise.
altKey {{readonlyInline}}booleantrue if the alt key was down when the event was fired. false otherwise.
metaKey {{readonlyInline}}booleantrue if the meta key was down when the event was fired. false otherwise.
+ +

Przykład

+ +
<div class="dropzone">
+  <div id="draggable" draggable="true" ondragstart="event.dataTransfer.setData('text/plain',null)">
+    This div is draggable
+  </div>
+</div>
+<div class="dropzone"></div>
+<div class="dropzone"></div>
+<div class="dropzone"></div>
+
+<style>
+  #draggable {
+    width: 200px;
+    height: 20px;
+    text-align: center;
+    background: white;
+  }
+
+  .dropzone {
+    width: 200px;
+    height: 20px;
+    background: blueviolet;
+    margin-bottom: 10px;
+    padding: 10px;
+  }
+</style>
+
+<script>
+  var dragged;
+
+  /* events fired on the draggable target */
+  document.addEventListener("drag", function( event ) {
+
+  }, false);
+
+  document.addEventListener("dragstart", function( event ) {
+      // store a ref. on the dragged elem
+      dragged = event.target;
+      // make it half transparent
+      event.target.style.opacity = .5;
+  }, false);
+
+  document.addEventListener("dragend", function( event ) {
+      // reset the transparency
+      event.target.style.opacity = "";
+  }, false);
+
+  /* events fired on the drop targets */
+  document.addEventListener("dragover", function( event ) {
+      // prevent default to allow drop
+      event.preventDefault();
+  }, false);
+
+  document.addEventListener("dragenter", function( event ) {
+      // highlight potential drop target when the draggable element enters it
+      if ( event.target.className == "dropzone" ) {
+          event.target.style.background = "purple";
+      }
+
+  }, false);
+
+  document.addEventListener("dragleave", function( event ) {
+      // reset background of potential drop target when the draggable element leaves it
+      if ( event.target.className == "dropzone" ) {
+          event.target.style.background = "";
+      }
+
+  }, false);
+
+  document.addEventListener("drop", function( event ) {
+      // prevent default action (open as link for some elements)
+      event.preventDefault();
+      // move dragged elem to the selected drop target
+      if ( event.target.className == "dropzone" ) {
+          event.target.style.background = "";
+          dragged.parentNode.removeChild( dragged );
+          event.target.appendChild( dragged );
+      }
+
+  }, false);
+</script>
+
+ +

Specyfikacja

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "interaction.html#dndevents", "drag event")}}{{Spec2("HTML WHATWG")}} 
{{SpecName("HTML5.1", "editing.html#dndevents", "drag event")}}{{Spec2("HTML5.1")}}Initial definition
+ +

Obsługiwane przeglądarki

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support4{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.9.1")}}10123.1
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewChrome for AndroidEdgeFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatIE("10")}}{{CompatNo}}{{CompatNo}}
+
+ +

Zobacz również

+ + diff --git a/files/pl/web/api/document/embeds/index.html b/files/pl/web/api/document/embeds/index.html new file mode 100644 index 0000000000..ca0ab4ff2f --- /dev/null +++ b/files/pl/web/api/document/embeds/index.html @@ -0,0 +1,22 @@ +--- +title: document.embeds +slug: Web/API/Document/embeds +tags: + - DOM + - DOM_0 + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/embeds +--- +

{{ ApiRef() }}

+

Podsumowanie

+

embeds zwraca listę obiektów OBJECT zagnieżdżonych w bieżącym dokumencie.

+

Składnia

+
listaWęzłów = document.embeds
+
+

Specyfikacja

+

{{ DOM0() }}

+


+ MSDN: embeds collection

+

{{ languages( { "en": "en/DOM/document.embeds" } ) }}

diff --git a/files/pl/web/api/document/execcommand/index.html b/files/pl/web/api/document/execcommand/index.html new file mode 100644 index 0000000000..0718107051 --- /dev/null +++ b/files/pl/web/api/document/execcommand/index.html @@ -0,0 +1,280 @@ +--- +title: Document.execCommand() +slug: Web/API/Document/execCommand +tags: + - API + - DOM + - Method + - NeedsBrowserCompatibility + - NeedsExample + - Reference + - edytor +translation_of: Web/API/Document/execCommand +--- +
+ +
Kiedy dokument HTML jest przełączony w tryb designMode, obiekt dokumentu udostępnia metodę execCommand, która pozwala uruchomić komendy manipulujące edytowalnym obszarem. Większość poleceń wpływa na zaznaczony obszar (pogrubienie, kursywa itd.), podczas gdy inne wstawiają nowe elementy (dodawanie linku) lub wpływają na całą linię (wcięcia). Przy użyciu contentEditable, wywołanie execCommand() wpływa na aktywny edytowalny element.
+ +

Składnia

+ +
bool = document.execCommand(aCommandName, aShowDefaultUI, aValueArgument)
+
+ +

Zwracane wartości

+ +

Obiekt {{jsxref('Boolean')}}, który zwraca false, jeśli polecenie jest niewspierane lub włączone. Uwaga: Zwraca prawdę tylko jeśli jest częścią UI, to znaczy - nie jest używana do sprawdzania wsparcia przeglądarki przed renderowaniem elementu, który wywołuje polecenie. 

+ +

Parametry

+ +
+
aCommandName
+
Typu {{domxref("DOMString")}} - określanazwę polecenia do wykonania. Zobacz {{anch("Commands")}}, aby wyświetlić listę poleceń.
+
aShowDefaultUI
+
Typu {jsxref("Boolean")}} - wskazuje czy domyślny interfejs użytkownika powinien być pokazany. Nie jest implementowane przez Mozillę.
+
aValueArgument
+
W przypadku komend wymagających wprowadzenia argumentu (takiego jak insertImage, gdzie jest to URL do grafiki do wstawienia), jest to {{domxref("DOMString")}} przekazujący te informacje. Podaj null, jeśli niewymagany.
+
+ +

Polecenia

+ +
+
backColor
+
Zmienia kolor tła. W trybie styleWithCss zmieia kolor jedynie zawierającego elementu. Wymaga podania ciągu znaków{{cssxref("<color>")}} jako wartości argumentu. Zwróć uwagę na to, że Internet Explorer używa tego do zmiany koloru tła tekstu.
+
bold
+
Włącza/wyłącza pogrubienie w zaznaczeniu lub miejscu wstawiania. IE używa znacznika {{HTMLElement("strong")}} zamiast {{HTMLElement("b")}}.
+
contentReadOnly
+
Sprawia, że dokument jest zawartość jest tylko do odczytu lub edytowalna. Wymaga prawdy/fałszu jako wartości argumentu. (Nie wspierany przez IE).
+
copy
+
Kopiuje zaznaczenie do schowkka. Warunki włączenia tego zachowania różnią się między przeglądarkami i zmieniają się w czasie. Sprawdź tabelę zgodności, aby określić, czy możesz użyć w swoim przypadku.
+
createLink
+
Wstawia link z zaznaczenia (wymaga zaznaczenia). HREF URI musi być podany jako wartość argumentu. URI musi zawierać co najmniej jeden zak, może być białym znakiem (IE utworzy link z wartością null).
+
cut
+
Usuwa zaznaczenie kopiując do schowka. Warunki włączenia tego zachowania różnią się między przeglądarkami i zmieniają się w czasie. Sprawdź tabelę zgodności, aby określić, czy możesz użyć w swoim przypadku.
+
decreaseFontSize
+
Wstawia znacznik {{HTMLElement("small")}} wokół zaznaczenia lub w miejscu wstawienia. (Nie wspierane przez IE.)
+
defaultParagraphSeparator
+
Zmienia separator akapitu używany podczas tworzenia nowych akapitów w edytowalnych regionach tekstowych.  Zobacz Differences in markup generation po więcej szczegółów.
+
delete
+
Usuwa zaznaczenie.
+
enableInlineTableEditing
+
Włącza lub wyłącza wstawianie wierszy i kolumn oraz elementy sterujące usuwaniem. (Nie obsługiwane przez Internet Explorer.)
+
enableObjectResizing
+
Umożliwia lub uniemożliwia zmianę rozmiaru uchwytów na obrakach lub innych skalowalnych obiektów.  (Nie wspierane przez IE)
+
fontName
+
Zmienia nazwę czcionki dla zaznaczenia lub w punkcie wstawiania. Wymaga ciągu znaków (np. "Arial") jako wartości argumentu.
+
fontSize
+
Zmienia rozmiar czcionki dla zaznaczenia lub w punkcie wstawiania. Wymaga rozmiaru czcionki HTML (1-7) jako wartości argumentu.
+
foreColor
+
Zmienia kolor czcionki dla zaznaczenia lub w punkcie wstawiania. Wymaga wartości koloru (w postaci ciągu znaków) jako wartości argumentu.
+
formatBlock
+
Wstawia tag stylu blokowego dla linii w zaznaczeniu, zastępując blokowy element zawierający linię, jeśli taki istnieje (w Firefoxie, BLOCKQUOTE jest wyjątkiem - zawinie blokowy element zawierający).  Wymaga ciągu znaków oznaczającego znacznik jako wartość argumentu. Można użyć praktycznie wszystkich (np. "H1", "P", "DL", "BLOCKQUOTE). (IE wspiera jedynie H1-H6, "ADDRESS", PRE, które jeszcze muszą zawierać nawiasy znaczników <>, tak jak "<h1">).
+
forwardDelete
+
Usuwa znak przed pozycją kursora.  Działa jak wciśnięcie klawisza Delete.
+
heading
+
Wstawia tag nagłówka naokoło zaznaczenia lub w miejscu wstawiania. Wymaga ciągu znaków oznaczającego nazwę tagu jako wartości argumentu (np. "H1", "H6"). (Nie wspierane przez IE ani Safari).
+
hiliteColor
+
Zmienia kolor tła dla zaznaczenia lub w miejscu wstawiania. Wymaga ciągu znaków w postaci wartości kolorów jako wartości argumentu. Do użycia tej funkcji jest wymagane użycie CSS. (Nie wspierane przez IE).
+
increaseFontSize
+
Wstawia tag BIG naokoło zaznaczenia lub w miejscu wstawiania. (Nie wspierane przez IE).
+
indent
+
Wcina wiersz zawierający zaznaczenie lub punkt wstawiania. W Firefixie, jeśli zaznaczenie obejmuje wiele linii na różnych poziomach wcięcia, jedynie ostatnie wcięte linie zostaną wcięte.
+
insertBrOnReturn
+
Kontroluje, czy klawisz Enter wstawia tag BR, czy dzieli elemet blokowy na dwa (Nie wspierane przez IE)
+
insertHorizontalRule
+
Wstawia poziomą linię w miejscu wstawiania (usuwa zaznaczenie).
+
insertHTML
+
Wstawia ciąg znaków w postaci kodu HTML (usuwa zaznaczenie). Wymaga poprawnego kodu jako wartość argumentu. (Nie wspierane prze
+
insertImage
+
Wstawia grafikę w punkcie wstawiania (usuwa zaznaczenie). Wymaga ciągu znaków w postaci SRC URI jako wartości argumentu. URI musi zawierać co najmniej jeden znak (może być to biały znak). (Nie wspierane przez IE).
+
insertOrderedList
+
Wstawia numerowaną listę dla zaznaczenia lub w punkcie wstawiania.
+
insertUnorderedList
+
Wstawia punktowaną listę dla zaznaczenia lub w punkcie wstawiania.
+
insertParagraph
+
Wstawia akapit naokoło zaznaczenia lub w danej linii. (IE wstawia akapit w miejscu wstaawiania i usuwa zaznaczenie).
+
insertText
+
Wstawia dany tekst w miejsce wstawiania (usuwa zaznaczenie).
+
italic
+
Włącza/wyłącza pochylenie dla zaznaczenia lub w miejscu wstawiania (IE używa tagu EM zamiast I).
+
justifyCenter
+
Wyśrodkowuje zaznaczenie lub miejsce wstawiania.
+
justifyFull
+
Justuje zaznaczenie lub miejsce wstawiania.
+
justifyLeft
+
Wyrównuje do lewej zaznaczenie lub miejsce wstawiania.
+
justifyRight
+
Wyrównuje do prawej zaznaczenie lub miejsce wstawiaia.
+
outdent
+
Wysuwa linię zawierającą zaznaczenie lub punkt wstawiania.
+
paste
+
Wstawia zawartość schowka w miejscu wstawiania (zastępuje zaznaczenie). Nie działa dla zawartości z internetu. Zobacz [1]
+
redo
+
Ponawia ostatnio cofniętą komendę.
+
removeFormat
+
Usuwa całe formatowanie z zaznaczenia.
+
selectAll
+
Zaznacza całą zawartość z edytowalnego obszaru.
+
strikeThrough
+
Włącza/wyłącza przekreślenie dla zaznaczenia lub w punkcie wstawiania.
+
subscript
+
Włącza/wyłącza indeks dolny dla zaznaczenia lub w punkcie wstawiania.
+
superscript
+
Włącza/wyłącza indeks górny dla zaznaczenia lub w punkcie wstawiania.
+
underline
+
Włącza/wyłącza podkreślenie dla zaznaczenia lub w punkcie wstawiania.
+
undo
+
Cofa ostatnio wykonaną komendę.
+
unlink
+
Usuwa tag kotwicy z zaznaczonego linku.
+
useCSS {{Deprecated_inline}}
+
Przełącza użycie HTML/CSS dla generowanego kodu. Wymaga prawdy/fałszu jako wartości argumentu. UWAGA: dla CSS wymaga fałszu, dla HTML - prawdy. (Nie jest wspierane przez IE). Deprecjonowana właściwość. Użyj styleWithCSS
+
styleWithCSS
+
Zastępuje useCSS; działa normalnie - dla CSS wymaga prawdy, fałsz generuje HTML.
+
+ +

Example

+ +

Zobacz how to use w CodePen.

+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML Editing', '#execcommand()', 'execCommand')}}{{Spec2('HTML Editing')}}Initial definition
+ +

Kompatybilność przeglądarek

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}[1]{{CompatUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}
insertBrOnReturn{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
copy/cut{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoDesktop(41)}}92910
defaultParagraphSeparator{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoDesktop(55)}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}[1]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
insertBrOnReturn{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
copy/cut{{CompatNo}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile(41)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatNo}}
defaultParagraphSeparator{{CompatNo}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile(55)}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatNo}}
+
+ +

[1] Przed przeglądarką Firefox 41 w pliku preferencji user.js trzeba było włączyć obsługę schowka. Aby uzyskać więcej informacji, zobacz Krótki przewodnik po preferencjach Mozilli. Jeśli polecenie nie było obsługiwane lub włączone, execCommand rzucał wyjątek zamiast zwracać false. W Firefoxie 41 i nowszych, schowek może zostać zapisany w dowolnym programie obsługi zdarzeń read the clipboard. WebExtensions can interact with the clipboard.

+ +

Przed przeglądarką Firefox 41 w pliku preferencji user.js trzeba było włączyć obsługę schowka. Aby uzyskać więcej informacji, zobacz Krótki przewodnik po preferencjach Mozilli. Jeśli polecenie nie było obsługiwane lub włączone, execCommand podnosił wyjątek zamiast zwracać fałsz. W przeglądarce Firefox 41 i nowszych schowek może zostać zapisany w dowolnej obsłudze zdarzeń, która może spowodować wyskoczenie okna (częściowo zaufane skrypty), ale żadna treść internetowa nie może odczytać schowka. WebExtensions mogą wchodzić w interakcje ze schowkiem.

+ +

Zobacz również

+ + diff --git a/files/pl/web/api/document/fgcolor/index.html b/files/pl/web/api/document/fgcolor/index.html new file mode 100644 index 0000000000..a9f0287372 --- /dev/null +++ b/files/pl/web/api/document/fgcolor/index.html @@ -0,0 +1,28 @@ +--- +title: document.fgColor +slug: Web/API/Document/fgColor +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/fgColor +--- +

{{ ApiRef() }}

+

Podsumowanie

+

fgColor pobiera/ustawia kolor pierwszoplanowy (kolor tekstu) bieżącego dokumentu.

+

Składnia

+
kolor = document.fgColor
+document.fgColor =kolor
+
+

Parametry

+ +

Przykład

+
document.fgColor = "white";
+document.bgColor = "darkblue";
+
+

Specyfikacja

+

DOM Level 0 - brak w specyfikacji.

+

{{ languages( { "en": "en/DOM/document.fgColor" } ) }}

diff --git a/files/pl/web/api/document/firstchild/index.html b/files/pl/web/api/document/firstchild/index.html new file mode 100644 index 0000000000..c2bc145b41 --- /dev/null +++ b/files/pl/web/api/document/firstchild/index.html @@ -0,0 +1,36 @@ +--- +title: document.firstChild +slug: Web/API/Document/firstChild +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Node/firstChild +--- +

{{ ApiRef() }}

+

Podsumowanie

+

document.firstChild zwraca pierwszy węzeł z listy bezpośrednich dzieci dokumentu.

+

Składnia

+
dziecko = document.firstChild
+
+

Parametry

+ +

Przykład

+
function fChild() {
+  f = document.firstChild;
+  alert(f.tagName);
+}
+// wyświetli: HTML
+
+

Uwagi

+

Zauważ, że możesz powrócić do drzewa DOM z tą własnością, by przejąć te węzły potomne, których potrzebujesz, ponieważ prawie zawsze firstChild zwraca element HTML.

+

Specyfikacja

+

firstChild

+

 

+

 

+
+  
+

{{ languages( { "en": "en/DOM/document.firstChild", "es": "es/DOM/document.firstChild", "fr": "fr/DOM/document.firstChild", "ja": "ja/DOM/document.firstChild" } ) }}

diff --git a/files/pl/web/api/document/forms/index.html b/files/pl/web/api/document/forms/index.html new file mode 100644 index 0000000000..dcba1e18e0 --- /dev/null +++ b/files/pl/web/api/document/forms/index.html @@ -0,0 +1,45 @@ +--- +title: document.forms +slug: Web/API/Document/forms +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/forms +--- +

{{ ApiRef() }}

+

Podsumowanie

+

forms zwraca listę elementów FORM z bieżącego dokumentu.

+

Składnia

+
listaWęzłów = document.forms
+
+

Przykład

+
<html>
+
+<head>
+<title> document.forms example</title>
+</head>
+
+<body>
+<form id="robby">
+ <input type="button" onclick="alert(document.forms[0].id);"
+ value="robby's form" />
+</form>
+
+<form id="dave">
+ <input type="button" onclick="alert(document.forms[1].id);"
+ value="dave's form" />
+</form>
+
+<form id="paul">
+ <input type="button" onclick="alert(document.forms[2].id);"
+ value="paul's form" />
+</form>
+
+</body>
+</html>
+
+

Specyfikacja

+

forms

+

{{ languages( { "en": "en/DOM/document.forms", "ja": "ja/DOM/document.forms" } ) }}

diff --git a/files/pl/web/api/document/getelementbyid/index.html b/files/pl/web/api/document/getelementbyid/index.html new file mode 100644 index 0000000000..51e1bd68c0 --- /dev/null +++ b/files/pl/web/api/document/getelementbyid/index.html @@ -0,0 +1,67 @@ +--- +title: document.getElementById +slug: Web/API/Document/getElementById +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/getElementById +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Zwraca element o określonym ID.

+ +

Składnia

+ +
var element = document.getElementById(id);
+
+ +

Parametry

+ + + +

Przykład

+ +
<html>
+<head>
+<title>Przykład getElementById</title>
+
+<script type="text/javascript">
+
+function changeColor(newColor)
+{
+ var elem = document.getElementById("para1");
+ elem.style.color = newColor;
+}
+</script>
+</head>
+
+<body>
+<p id="para1">Jakiś tekst</p>
+<button onclick="changeColor('blue');">niebieski</button>
+<button onclick="changeColor('red');">czerwony</button>
+</body>
+</html>
+
+ +

Uwagi

+ +

getElementById jest absolutną podstawą DOM. Jedną z najważniejszych zasad w programowaniu DOM jest unikalne identyfikowanie elementów, dzięki czemu można je przechwycić i manipulować nimi.

+ +

Jeżeli nie ma elementu o podanym ID, funkcja zwraca NULL. Zauważ też, że implementacja DOM musi wiedzieć, które atrybuty mają typ ID. Atrybuty o nazwie "ID" nie mają typu ID, o ile nie zostanie to tak zdefiniowane. Implementacje, które nie wiedzą, czy atrybuty mają typ ID czy nie, powinny zwracać NULL.

+ +

getElementById wprowadzono w DOM Level 2.

+ +

Specyfikacja

+ + + +

{{ languages( { "en": "en/DOM/document.getElementById", "fr": "fr/DOM/document.getElementById", "ja": "ja/DOM/document.getElementById" } ) }}

diff --git a/files/pl/web/api/document/getelementsbyclassname/index.html b/files/pl/web/api/document/getelementsbyclassname/index.html new file mode 100644 index 0000000000..a9e2037ac3 --- /dev/null +++ b/files/pl/web/api/document/getelementsbyclassname/index.html @@ -0,0 +1,82 @@ +--- +title: Document.getElementsByClassName() +slug: Web/API/Document/getElementsByClassName +tags: + - API + - DOM + - HTML5 + - Klasy +translation_of: Web/API/Document/getElementsByClassName +--- +

{{APIRef("DOM")}}

+ +

Zwraca obiekt podobny do tablicy, zawierający wszystkie elementy, które mają przypisaną daną klasę. Kiedy użyjemy tej funkcji w odniesieniu do elementu document, cały dokument jest przeszukiwany - na wszystkich poziomach.

+ +

Możesz również użyć funkcji {{domxref("Element.getElementsByClassName", "getElementsByClassName()")}} na dowolnym elemencie; wtedy zwróci jedynie elementy zawierające daną klasę, które zawierają się w obrębie elementu wskazanego przez nas.

+ +

Składnia

+ +
var elements = document.getElementsByClassName(names); // or:
+var elements = rootElement.getElementsByClassName(names);
+ + + +

Przykłady

+ +

Szukamy wszystkich elementów posiadających klasę 'test':

+ +
document.getElementsByClassName('test');
+ +

Szukamy elementów, które posiadają jednocześnie klasę 'red' oraz 'test':

+ +
document.getElementsByClassName('red test');
+ +

Szukamy elementów posiadających klasę 'test', w obrębie elementu o ID 'main':

+ +
document.getElementById('main').getElementsByClassName('test');
+ +

Możemy też użyć metody Array.prototype. W ten sposób znajdziemy wszystkie elementy div posiadające klasę 'test':

+ +
var testElements = document.getElementsByClassName('test');
+var testDivs = Array.prototype.filter.call(testElements, function(testElement){
+    return testElement.nodeName === 'DIV';
+});
+ +

Uwagi

+ +

Należy zwrócić uwagę na różnice w zwracanej wartości w zależności od składni (aby została zwrócona konkretna wartość należy posłużyć się indeksem):

+ +
<!doctype html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title>Document</title>
+</head>
+<body>
+    <div id="parent-id">
+        <p>hello word1</p>
+        <p class="test">hello word2</p>
+        <p >hello word3</p>
+        <p>hello word4</p>
+    </div>
+    <script>
+        var parentDOM = document.getElementById("parent-id");
+
+        var test=parentDOM.getElementsByClassName("test");//test is not target element
+        console.log(test);//HTMLCollection[1]
+
+        var testTarget=parentDOM.getElementsByClassName("test")[0];//here , this element is target
+        console.log(testTarget);//<p class="test">hello word2</p>
+    </script>
+</body>
+</html>
+ +

Specyfikacja

+ + diff --git a/files/pl/web/api/document/getelementsbyname/index.html b/files/pl/web/api/document/getelementsbyname/index.html new file mode 100644 index 0000000000..1cadc785de --- /dev/null +++ b/files/pl/web/api/document/getelementsbyname/index.html @@ -0,0 +1,35 @@ +--- +title: document.getElementsByName +slug: Web/API/Document/getElementsByName +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/getElementsByName +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca listę elementów w dokumencie o żądanym atrybucie name.

+

Składnia

+
elementy = document.getElementsByName(nazwa)
+
+

Parametry

+ +

Przykład

+
// zwraca niektóre z DIV-ów
+<div name="up">200</div>
+<div name="up">145</div>
+<div name="down">146</div>
+<div name="other">178</div>
+up_divs = document.getElementsByName("up");
+dump(up_divs.item(0).tagName); // zwraca "div"
+
+

Uwagi

+

document.getElementsByName zwraca listę węzłów wszystkich elementów o zadanej wartości atrybutu name. W przeciwieństwie do getElementsByTagName, który analizuje samą nazwę elementu, ta metoda pracuje tylko na elementach, których atrybut name został wyraźnie podany.

+

Specyfikacja

+

getElementsByName

+

{{ languages( { "en": "en/DOM/document.getElementsByName", "fr": "fr/DOM/document.getElementsByName", "ja": "ja/DOM/document.getElementsByName" } ) }}

diff --git a/files/pl/web/api/document/getelementsbytagname/index.html b/files/pl/web/api/document/getelementsbytagname/index.html new file mode 100644 index 0000000000..b4db8f428d --- /dev/null +++ b/files/pl/web/api/document/getelementsbytagname/index.html @@ -0,0 +1,108 @@ +--- +title: document.getElementsByTagName +slug: Web/API/Document/getElementsByTagName +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Strony_wymagające_dopracowania + - Wszystkie_kategorie +translation_of: Web/API/Document/getElementsByTagName +--- +

{{ ApiRef("DOM") }}

+ +

Podsumowanie

+ +

Zwraca listę elementów o podanej nazwie znacznika. Przeszukiwany jest cały dokument, łącznie z głównym węzłem.

+ +

Składnia

+ +
elements = document.getElementsByTagName(name)
+
+ + + +

Przykład

+ +

W poniższym przykładzie getElementsByTagName starts from a particular parent element, and searches topdown recursively through the DOM from that parent element, looking for child elements matching the tag name parameter.

+ +

Zauważ, że gdy węzeł, w którym przywołano getElementsByTagName, nie jest węzłem document, to w rzeczywistości użyta jest metoda element.getElementsByTagName.

+ +
<html>
+
+<head>
+<title>Przykład getElementsByTagName</title>
+
+<script type="text/javascript">
+
+function getAllParaElems()
+{
+  var allParas = document.getElementsByTagName("p");
+
+  var num = allParas.length;
+
+  alert("W tym dokumencie jest " + num + " elementów <p>");
+}
+
+
+function div1ParaElems()
+{
+  var div1 = document.getElementById("div1")
+  var div1Paras = div1.getElementsByTagName("p");
+
+  var num = div1Paras.length;
+
+  alert("W elemencie div1 znajduje się " + num + " elementów <p>");
+}
+
+
+function div2ParaElems()
+{
+  var div2 = document.getElementById("div2")
+  var div2Paras = div2.getElementsByTagName("p");
+
+  var num = div2Paras.length;
+
+  alert("W elemencie div2 znajduje się " + num + " elementów <p>");
+}
+
+</script>
+</head>
+
+<body style="border: solid green 3px">
+<p>Trochę zewnętrznego tekstu</p>
+<p>Trochę zewnętrznego tekstu</p>
+
+  <div id="div1" style="border: solid blue 3px">
+    <p>Trochę tekstu w div1</p>
+    <p>Trochę tekstu w div1</p>
+    <p>Trochę tekstu w div1</p>
+
+    <div id="div2" style="border: solid red 3px">
+    <p>Trochę tekstu w div2</p>
+    <p>Trochę tekstu w div2</p>
+    </div>
+  </div>
+
+<p>Trochę zewnętrznego tekstu</p>
+<p>Trochę zewnętrznego tekstu</p>
+
+<button onclick="getAllParaElems();">
+ pokaż wszystkie elementy p w dokumencie</button><br />
+
+<button onclick="div1ParaElems();">
+ pokaż wszystkie elementy p w elemencie div1</button><br />
+
+<button onclick="div2ParaElems();">
+ pokaż wszystkie elementy p w elemencie div2</button>
+
+</body>
+</html>
+
+ +

Specyfikacja

+ +

DOM Level 2 Core: Document.getElementsByTagName

diff --git a/files/pl/web/api/document/hasfocus/index.html b/files/pl/web/api/document/hasfocus/index.html new file mode 100644 index 0000000000..afaa6079af --- /dev/null +++ b/files/pl/web/api/document/hasfocus/index.html @@ -0,0 +1,25 @@ +--- +title: document.hasFocus +slug: Web/API/Document/hasFocus +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/hasFocus +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Własność hasFocus zwraca wartość true, jeżeli fokus jest zlokalizowany w dowolnym miejscu danego dokumentu. {{ Note("Ten atrybut jest częścią specyfikacji HTML 5, która jest wciąż opracowywana.") }}

+

Składnia

+
focused = document.hasFocus();
+
+

Przykład

+

Specyfikacja

+

Zarządzanie fokusem

+

 

+

 

+

 

+
+  
+

{{ languages( { "en": "en/DOM/document.hasFocus", "es": "es/DOM/element.hasFocus", "fr": "fr/DOM/document.hasFocus", "ja": "ja/DOM/document.hasFocus" } ) }}

diff --git a/files/pl/web/api/document/head/index.html b/files/pl/web/api/document/head/index.html new file mode 100644 index 0000000000..d5436385fa --- /dev/null +++ b/files/pl/web/api/document/head/index.html @@ -0,0 +1,110 @@ +--- +title: Document.head +slug: Web/API/Document/head +translation_of: Web/API/Document/head +--- +

{{APIRef("DOM")}}

+ +

Zwraca element {{HTMLElement("head")}} aktualnego dokumentu. Jeżeli występuje więcej niż jeden element <head>, zwrócony zostanie tylko pierwszy.

+ +

Syntax

+ +
var objRef = document.head;
+
+ +

Przykład

+ +
// in HTML: <head id="my-document-head">
+var aHead = document.head;
+
+alert(aHead.id); // "my-document-head";
+
+alert( document.head === document.querySelector("head") ); // true
+
+ +

Uwagi

+ +

document.head jest atrybutem tylko do odczytu. Próby przypisania mu wartości nie spowodują żadnego efektu czy skutku ubocznego (przejdą 'po cichu') lub, jeżeli pracujemy w ECMAScript Strict Mode w przeglądarce Gecko, zostanie rzucony TypeError.

+ +

Specyfikacje

+ + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG','dom.html#dom-document-head','Document.head')}}{{Spec2('HTML WHATWG')}}Initial definition.
{{SpecName('HTML5.1','dom.html#dom-document-head','Document.head')}}{{Spec2('HTML5.1')}} 
{{SpecName('HTML5 W3C','dom.html#dom-document-head','Document.head')}}{{Spec2('HTML5 W3C')}} 
+ +

Kompatybilność z przeglądarkami

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support4.0{{CompatGeckoDesktop("2")}}9.011.05.0
+
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatGeckoMobile("2")}}9.0{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Zobacz także

+ + diff --git a/files/pl/web/api/document/height/index.html b/files/pl/web/api/document/height/index.html new file mode 100644 index 0000000000..1f777a7eb5 --- /dev/null +++ b/files/pl/web/api/document/height/index.html @@ -0,0 +1,34 @@ +--- +title: document.height +slug: Web/API/Document/height +tags: + - DOM + - DOM_0 + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/height +--- +

{{ ApiRef() }}

+

Podsumowanie

+

height pobiera/ustawia wysokość dokumentu.

+

Składnia

+
wysokość = document.height
+document.height =wysokość
+
+

Parametry

+ +

Przykład

+
// zmniejsz okno po załadowaniu
+function onLoad() {
+    document.height = "200";
+    document.width = "200";
+}
+
+

Uwagi

+

Zobacz także DOM:document.width.

+

Specyfikacja

+

{{ DOM0() }}

+

{{ languages( { "en": "en/DOM/document.height" } ) }}

diff --git a/files/pl/web/api/document/images/index.html b/files/pl/web/api/document/images/index.html new file mode 100644 index 0000000000..e7d21794da --- /dev/null +++ b/files/pl/web/api/document/images/index.html @@ -0,0 +1,31 @@ +--- +title: document.images +slug: Web/API/Document/images +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/images +--- +

{{ ApiRef() }}

+

Podsumowanie

+

document.images zwraca listę obrazków w dokumencie.

+

Składnia

+
listaWęzłów = document.images
+
+

Przykład

+
var ilist = document.images;
+for(var i = 0; i < ilist.length; i++) {
+    if(ilist[i] == "banner.gif") {
+         // found the banner
+    }
+}
+
+

 

+

Uwagi

+

document.images.length – własność, zwraca liczbę obrazków na stronie.

+

document.images jest częścią DOM HTML i działa tylko dla dokumentów HTML.

+

Specyfikacja

+

DOM Level 2 HTML: HTMLDocument.images

+

{{ languages( { "ru": "ru/DOM/document.images", "en": "en/DOM/document.images", "fr": "fr/DOM/document.images" } ) }}

diff --git a/files/pl/web/api/document/implementation/index.html b/files/pl/web/api/document/implementation/index.html new file mode 100644 index 0000000000..3fe4d51af0 --- /dev/null +++ b/files/pl/web/api/document/implementation/index.html @@ -0,0 +1,21 @@ +--- +title: document.implementation +slug: Web/API/Document/implementation +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/implementation +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca obiekt implementacji DOM powiązanej z bieżącym dokumentem.

+

Składnia

+
obiektDOMImplementation = document.DOMImplentation
+
+

Uwagi

+

Obiekt DOMImplementaion, jeżeli jest dostępny, stanowi specjalny obiekt zapewniający możliwość kontrolowania spraw poza pojedynczym dokumentem. Na przykład interfejs DOMImplementation zawiera metodę createDocumentType pozwalającą na tworzenie DTD dla jednego lub więcej dokumentów zarządzanych przez implementację.

+

Specyfikacja

+

implementation (?)

+

{{ languages( { "en": "en/DOM/document.implementation" } ) }}

diff --git a/files/pl/web/api/document/importnode/index.html b/files/pl/web/api/document/importnode/index.html new file mode 100644 index 0000000000..be2cdf6367 --- /dev/null +++ b/files/pl/web/api/document/importnode/index.html @@ -0,0 +1,57 @@ +--- +title: document.importNode +slug: Web/API/Document/importNode +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Strony_wymagające_dopracowania + - Wszystkie_kategorie +translation_of: Web/API/Document/importNode +--- +

{{ ApiRef("DOM") }}

+ +

Podsumowanie

+ +

Tworzy kopię węzła z zewnętrznego dokumentu, która może być umieszczona wewnątrz bieżącego dokumentu.

+ +

Składnia

+ +
var node = document.importNode(externalNode,deep);
+
+ +
+
node
+
Zaimportowany węzeł
+ Własność parentNode jest ustawiona na null, ponieważ nie został jeszcze wstawiony do drzewa dokumentu
+
externalNode
+
Węzeł, bądź DocumentFragment przeznaczony do zaimportowania do bieżącego dokumentu.
+
deep
+
Boolean mówiący, czy importować potomki externalNode
+
+ +

Przykład

+ +
var iframe = document.getElementsByTagName("iframe")[0];
+var oldNode = iframe.contentDocument.getElementById("myNode");
+var newNode = document.importNode(oldNode,true);
+document.getElementById("container").appendChild(newNode);
+
+ +

Uwagi

+ +

Pierwotny węzeł nie jest usunięty z oryginalnego dokumentu. Importowany węzeł jest klonem oryginału .

+ + +

Przed włączeniem węzłów pochodzących z zewnętrznych dokumentów do bieżącego dokumentu konieczne jest ich sklonowanie za + pomocą metody document.importNode() (lub zaadaptowanie przy użyciu metody document.adoptNode()). Więcej informacji na temat własności + Node.ownerDocument znajduje się na liście najczęściej zadawanych pytań na temat + DOM w witrynie W3C.

+ +

Aktualnie Firefox nie wymusza tej reguły (robił to przez pewien czas podczas cykli rozwojowych Firefoksa 3, ale zbyt + dużo stron przestawało działać po wymuszeniu tej reguły). Zachęcamy autorów stron do poprawienia ich kodu dla lepszej + kompatybilności w przyszłości.

+ +

Specyfikacja

+ +

DOM Level 2 Core: Document.importNode

diff --git a/files/pl/web/api/document/index.html b/files/pl/web/api/document/index.html new file mode 100644 index 0000000000..a5aa06d6dd --- /dev/null +++ b/files/pl/web/api/document/index.html @@ -0,0 +1,332 @@ +--- +title: document +slug: Web/API/Document +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document +--- +

{{ ApiRef() }}

+ +

Wprowadzenie

+ +

Obiekt document stanowi w DOM ogólny sposób reprezentowania dokumentów HTML, XHTML i XML. Poza ogólnym interfejsem dokumentu, w ponizszej liscie uwzgledniono takze DOM HTMLDocument, bedacy bardziej wyspecjalizowanym interfejsem, przeznaczonym do pracy z dokumentami HTML (np. wlasnosci takie jak document.cookie, document.alinkColor). Czesci tego bardziej wyspecjalizowanego interfejsu zostaly oznaczone gwiazdka (*).

+ +

document zawarty jest w obiekcie window i moze zawierac dowolna liczbe elementów.

+ +

Tak jak widac na ponizszej liscie, interfejsy document odpowiadaja za rzeczy takie jak typ dokumentu, jego cechy, jak kolory czy formatowanie, wtyczki i aplety przedstawiane uzytkownikowi, ale sa tu tez metody do tworzenia węzłów potomnych dokumentu, a takze elementy znajdujace sie zwykle w reprezentacji dokumentu, jak <BODY>.

+ +

Wlasnosci

+ +
+
document.alinkColor* {{ Deprecated_inline() }}
+
Zwraca lub ustawia kolor aktywnych odnośników w dokumencie.
+
+ +
+
document.anchors*
+
Zwraca listę wszystkich kotwic w dokumencie.
+
+ +
+
document.applets*
+
Zwraca uporządkowaną listę apletów w dokumencie.
+
+ +
+
document.bgColor* {{ Deprecated_inline() }}
+
Pobiera/ustawia kolor tła dokumentu.
+
+ +
+
document.body*
+
Zwraca węzeł elementu BODY w dokumencie.
+
+ +
+
document.characterSet
+
Zwraca nazwę zestawu znaków uzytego w dokumencie.
+
+ +
+
document.compatMode*
+
Wskazuje, czy dokument jest renderowany w trybie zgodności wstecznej czy w trybie standardów.
+
+ +
+
document.contentType
+
Zwraca Content-Type z nagłówka MIME bieżącego dokumentu.
+
+ +
+
document.cookie*
+
Zwraca rozdzielona średnikami listę ciasteczek dokumentu bądź zapisuje pojedyncze ciasteczko.
+
+ +
+
document.defaultView
+
Zwraca referencje do obiektu window.
+
+ +
+
document.designMode*
+
Pobiera/ustawia możliwość edytowania w trybie WYSIWYG za pomocą edytora Midas. Może zostać użyty wyłącznie w dokumentach HTML.
+
+ +
+
document.doctype
+
Zwraca definicje typu dokumentu (DTD).
+
+ +
+
document.documentElement
+
Zwraca element będący bezpośrednim dzieckiem dokumentu.W dokumentach <HTML> jest to zazwyczaj element.
+
+ +
+
document.documentURIObject {{ Fx_minversion_inline(3) }}
+
Zwraca obiekt nsIURI reprezentujący URI dokumentu. Własność ta jest wspomagana wyłącznie z kodu JavaScriptu.
+
+ +
+
document.domain*
+
Zwraca domenę bieżącego dokumentu.
+
+ +
+
document.embeds*
+
Zwraca listę obiektów (OBJECT) zagnieżdżonych w dokumencie.
+
+ +
+
document.fgColor* {{ Deprecated_inline() }}
+
Pobiera/ustawia kolor pierwszoplanowy (kolor tekstu) w dokumencie.
+
+ +
+
document.firstChild
+
Zwraca pierwszy węzeł spośród bezpośrednich dzieci dokumentu (zob. własność elementów firstChild).
+
+ +
+
document.forms*
+
Zwraca listę elementów FORM w dokumencie.
+
+ +
+
document.height*
+
Pobiera/ustawia wysokość dokumentu.
+
+ +
+
document.images*
+
Zwraca listę obrazków w dokumencie.
+
+ +
+
document.implementation*
+
Zwraca obiekt implementacji DOM powiązany z bieżącym dokumentem.
+
+ +
+
document.lastModified*
+
Zwraca datę ostatniej modyfikacji dokumentu.
+
+ +
+
document.linkColor* {{ Deprecated_inline() }}
+
Pobiera/ustawia kolor odnośników w dokumencie.
+
+ +
+
document.links*
+
Zwraca listę wszystkich odnośników w dokumencie.
+
+ +
+
document.location*
+
Zwraca URI bieżącego dokumentu.
+
+ +
+
document.namespaceURI
+
Zwraca przestrzeń nazw XML dokumentu.
+
+ +
+
document.plugins*
+
Zwraca listę dostępnych wtyczek.
+
+ +
+
document.popupNode
+
Zwraca węzeł, do którego odwoływał sie {{ XULElem("popup") }} (wyłącznie dokumenty XUL).
+
+ +
+
document.referrer*
+
Zwraca URI strony, która przekierowała do bieżącej strony.
+
+ +
+
document.styleSheets*
+
Zwraca listę obiektów typu stylesheet w bieżącym dokumencie.
+
+ +
+
document.title*
+
Zwraca tytuł bieżącego dokumentu.
+
+ +
+
document.tooltipNode
+
Zwraca węzeł, który jest bieżącym celem {{ XULElem("tooltip") }}.
+
+ +
+
document.URL
+
Zwraca ciąg znaków zawierający adres URL bieżącego dokumentu.
+
+ +
+
document.vlinkColor* {{ Deprecated_inline() }}
+
Pobiera/ustawia kolor odwiedzonych odnośników.
+
+ +
+
document.width*
+
Zwraca szerokość bieżącego dokumentu.
+
+ +

Metody

+ +
+
document.clear* {{ Deprecated_inline() }}
+
W wiekszosci nowoczesnych przegladarek wlacznie z Firefoksem oraz Internet Explorerem metoda ta nie robi nic.
+
+ +
+
document.close*
+
Konczy dopisywanie do strumienia dokumentu.
+
+ +
+
document.createAttribute
+
Tworzy i zwraca nowy wezel atrybutu.
+
+ +
+
document.createDocumentFragment
+
Tworzy nowy fragment dokumentu.
+
+ +
+
document.createElement
+
Tworzy nowy element o podanej nazwie.
+
+ +
+
document.createElementNS
+
Tworzy nowy element o podanej nazwie i URI przestrzeni nazw.
+
+ +
+
document.createNSResolver
+
Tworzy XPathNSResolver.
+
+ +
+
document.createTextNode
+
Tworzy nowy wezel tekstowy.
+
+ +
+
document.createTreeWalker
+
Tworzy obiekt TreeWalker.
+
+ +
+
document.createEvent
+
Tworzy obiekt zdarzenia.
+
+ +
+
document.createRange
+
Tworzy obiekt Range.
+
+ +
+
document.execCommand
+
Wykonuje komende dla edytora Midas.
+
+ +
+
document.evaluate
+
Wykonuje wyrazenie XPath.
+
+ +
+
document.getElementById
+
Zwraca referencje do elementu o podanym ID.
+
+ +
+
document.getElementsByName
+
Zwraca liste elementów o podanej nazwie.
+
+ +
+
document.getElementsByTagName
+
Zwraca liste elementów o danej nazwie znacznika.
+
+ +
+
document.importNode
+
Zwraca kopie wezla z zewnetrznego dokumentu.
+
+ +
+
document.loadOverlay
+
{{ Fx_minversion_inline(1.5) }} Laduje nakladke XUL. Dziala to tylko w dokumentach XUL.
+
+ +
+
document.open*
+
Otwiera strumien dokumentu do zapisu.
+
+ +
+
document.queryCommandEnabled*
+
Zwraca prawde, jesli komenda edytora Midas moze byc wykonana na biezacym zakresie.
+
+ +
+
document.queryCommandIndeterm*
+
Zwraca prawde, jesli komenda edytora Midas jest w stanie nieokreslonym dla biezacego zakresu.
+
+ +
+
document.queryCommandState*
+
Zwraca prawde, jesli komenda edytora Midas zostala wykonana na biezacym zakresie.
+
+ +
+
document.queryCommandValue*
+
Zwraca wartosc biezacego zakresu dla komendy edytora Midas.Wraz z Firefoksem 2.0.0.2 queryCommandValue zwróci pusty ciag jesli wartosc nie zostala ustawiona.
+
+ +
+
document.write*
+
Zapisuje tekst w dokumencie.
+
+ +
+
document.writeln*
+
Zapisuje linie tekstu w dokumencie.
+
+ +

 

+ +

{{ languages( { "en": "en/DOM/document", "es": "es/DOM/document", "fr": "fr/DOM/document", "ja": "ja/DOM/document", "zh-cn": "cn/DOM/document", "de" : "de/DOM/document" } ) }}

diff --git a/files/pl/web/api/document/lastmodified/index.html b/files/pl/web/api/document/lastmodified/index.html new file mode 100644 index 0000000000..a79e097ab8 --- /dev/null +++ b/files/pl/web/api/document/lastmodified/index.html @@ -0,0 +1,25 @@ +--- +title: document.lastModified +slug: Web/API/Document/lastModified +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/lastModified +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca datę i czas ostatniej modyfikacji dokumentu.

+

Składnia

+
ciąg = document.lastModified
+
+

Przykład

+
dump(document.lastModified);
+// zwróci np.: Tuesday, July 10, 2001 10:19:42
+
+

Uwagi

+

Zauważ, że lastModified będąc ciągiem nie może zostać łatwo użyte do porównywania dat modyfikacji między dokumentami.

+

Specyfikacja

+

(DOM Level 0 - brak w specyfikacji (?))

+

{{ languages( { "en": "en/DOM/document.lastModified" } ) }}

diff --git a/files/pl/web/api/document/linkcolor/index.html b/files/pl/web/api/document/linkcolor/index.html new file mode 100644 index 0000000000..ef025b4bfa --- /dev/null +++ b/files/pl/web/api/document/linkcolor/index.html @@ -0,0 +1,33 @@ +--- +title: document.linkColor +slug: Web/API/Document/linkColor +tags: + - DOM + - DOM_0 + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/linkColor +--- +

{{ ApiRef() }}

+

Podsumowanie

+

{{ Deprecated_header() }} linkColor pobiera/ustawia kolor odnośników w dokumencie.

+

Składnia

+
kolor = document.linkColor
+document.linkColor =kolor
+
+

Parametry

+ +

Uwagi

+

document.linkColor jest przestarzałe w DOM Level 2 HTML.

+

Rekomendowaną alternatywą jest pobranie/ustawienie własności CSS {{ Cssxref("color") }} na elemencie HTML anchor (<a>) links (np: a {color:red;}).

+

Kolejną alternatywą document.body.link mimo, że jest przestarzałe w HTML 4.01 szczególnie przy użyciu alternatywnego CSS.

+

Przykład

+
document.linkColor = "blue";
+
+

Specyfikacja

+

{{ DOM0() }}

+

MSDN: Własność linkColor

+

{{ languages( { "en": "en/DOM/document.linkColor" } ) }}

diff --git a/files/pl/web/api/document/links/index.html b/files/pl/web/api/document/links/index.html new file mode 100644 index 0000000000..d4ed79c435 --- /dev/null +++ b/files/pl/web/api/document/links/index.html @@ -0,0 +1,30 @@ +--- +title: document.links +slug: Web/API/Document/links +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/links +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Własność links zwraca zestaw wszystkich elementów AREA i A z ustawioną wartością atrybutu href.

+

Składnia

+
listaWęzłów = document.links
+
+

Przykład

+
var links = document.links;
+for(var i = 0; i < links.length; i++) {
+  var linkHref = document.createTextNode(links[i].href);
+  var lineBreak = document.createElement("br");
+  document.body.appendChild(linkHref);
+  document.body.appendChild(lineBreak);
+}
+
+

Specyfikacja

+

links

+
+  
+

{{ languages( { "en": "en/DOM/document.links", "it": "it/DOM/document.links", "ja": "ja/DOM/document.links" } ) }}

diff --git a/files/pl/web/api/document/location/index.html b/files/pl/web/api/document/location/index.html new file mode 100644 index 0000000000..6a754d5c0d --- /dev/null +++ b/files/pl/web/api/document/location/index.html @@ -0,0 +1,37 @@ +--- +title: document.location +slug: Web/API/Document/location +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/location +--- +

{{ ApiRef() }}

+ +

Podsumowanie

+ +

Pobiera URL bieżącego dokumentu.

+ +

Składnia

+ +
ciąg = document.location
+
+ +

Przykład

+ +
dump(document.location);
+// zwraca ciąg taki jak np.:
+// http://www.peoplemagazine.com/juicybits.html
+
+ +

Uwagi

+ +

document.location działa tak samo jak document.URL. Obydwie te własności są tylko do odczytu, w przeciwieństwie do window.location, które można ustawiać. Ponieważ document reprezentuje jeden dokument lub URL, nie można zmieniać jego lokalizacji.

+ +

Specyfikacja

+ +

DOM Level 0 - brak w specyfikacji.

+ +

{{ languages( { "en": "/en/DOM/document.location" } ) }}

diff --git a/files/pl/web/api/document/namespaceuri/index.html b/files/pl/web/api/document/namespaceuri/index.html new file mode 100644 index 0000000000..d6f9e8ac44 --- /dev/null +++ b/files/pl/web/api/document/namespaceuri/index.html @@ -0,0 +1,25 @@ +--- +title: document.namespaceURI +slug: Web/API/Document/namespaceURI +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Node/namespaceURI +--- +

{{ ApiRef() }}

+

Podsumowanie

+

namespaceURI zwraca przestrzeń nazw XML dokumentu.

+

Składnia

+
NSURI = document.namespaceURI
+
+

Parametry

+ +

Uwagi

+

DOM jako takie nie obsługuje ani nie wymaga walidacji przestrzeni nazw. Przeprowadzenie walidacji, jeśli jest taka potrzeba, zależy od aplikacji obsługującej DOM. Zauważ też, że prefiks przestrzeni nazw nie może zostać zmieniony, kiedy już raz zostanie przypisany węzłowi.

+

Specyfikacja

+

namespaceURI

+

{{ languages( { "en": "en/DOM/document.namespaceURI", "fr": "fr/DOM/document.namespaceURI" } ) }}

diff --git a/files/pl/web/api/document/open/index.html b/files/pl/web/api/document/open/index.html new file mode 100644 index 0000000000..2a7b0347b7 --- /dev/null +++ b/files/pl/web/api/document/open/index.html @@ -0,0 +1,40 @@ +--- +title: document.open +slug: Web/API/Document/open +tags: + - DOM + - Wszystkie_kategorie +translation_of: Web/API/Document/open +--- +

{{APIRef("DOM")}}

+ +

Podsumowanie

+ +

Metoda document.open otwiera strumień dokumentu do zapisu.

+ +

Składnia

+ +
document.open()
+
+ +

Przykład

+ +
//W tym przykładzie zawartość dokumentu jest
+//usuwana przy reinicjalizacji poprzez open()
+
+document.write("<html><p>wyczyść to</p></html>");
+document.open();
+//dokument jest pusty
+
+ +

Uwagi

+ +

Jeżeli dokument docelowy istnieje, metoda ta wyczyści go (zob. powyzszy przykład). document.open jest wywoływane również wtedy, gdy zostanie użyte document.write po załadowaniu dokumentu.

+ +

Specyfikacja

+ +

open

+ +
 
+ +

{{ languages( { "en": "en/DOM/document.open", "fr": "fr/DOM/document.open", "ja": "ja/DOM/document.open" } ) }}

diff --git a/files/pl/web/api/document/plugins/index.html b/files/pl/web/api/document/plugins/index.html new file mode 100644 index 0000000000..fb946ff710 --- /dev/null +++ b/files/pl/web/api/document/plugins/index.html @@ -0,0 +1,40 @@ +--- +title: document.plugins +slug: Web/API/Document/plugins +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/plugins +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca listę aktualnie zainstalowanych wtyczek.

+

Składnia

+
obiektPluginArray = document.plugins
+
+

Przykład

+

Poniższy przykład wyświetla informację o zainstalowanych wtyczkach dla dokumentu wysokiego poziomu. Zwróć uwagę na właściwości obiektu Plugin: length (dla tablicy wtyczek), name, filename i description.

+
 <script TYPE="text/javascript">
+  <!--
+   var L = navigator.plugins.length
+   document.write( L );
+   document.write("Plugins".bold());
+   document.write("<BR>");
+   document.write("Name | Filename | description".bold());
+   document.write("<BR>");
+   for(i=0; i<L; i++){
+     document.write(navigator.plugins[i].name);
+     document.write(" | ".bold());
+     document.write(navigator.plugins[i].filename);
+     document.write(" | ".bold());
+     document.write(navigator.plugins[i].description);
+     document.write("<BR>");
+   }
+  //-->
+ </script>
+
+

Specyfikacja

+

DOM Level 0 - brak w specyfikacji.

+

{{ languages( { "en": "en/DOM/document.plugins" } ) }}

diff --git a/files/pl/web/api/document/queryselector/index.html b/files/pl/web/api/document/queryselector/index.html new file mode 100644 index 0000000000..cecd7c4f14 --- /dev/null +++ b/files/pl/web/api/document/queryselector/index.html @@ -0,0 +1,159 @@ +--- +title: Document.querySelector() +slug: Web/API/Document/querySelector +tags: + - API + - DOM + - Metodă + - Referencje + - Selektory +translation_of: Web/API/Document/querySelector +--- +
{{ ApiRef("DOM") }}
+ +

Funkcja zwraca pierwszy element wewnątrz dokumentu, który pasuje do podanego selektora lub grupy selektorów.

+ +

Składnia

+ +
element = document.querySelector(selectors);
+
+ +

gdzie

+ + + +

Przykład

+ +

W tym przykladzie zostaje zwrócony pierwszy element w dokumencie o klasie "myclass":

+ +
var el = document.querySelector(".myclass");
+
+ +

Przykład: Powerful

+ +

Selectory mogą być naprawdę potężne, jak pokazano na poniższym przykładzie. Pierwszy element <input name="login"/> wewnątrz <div class="user-panel main"> w dokumencie zostaje zwrócony:

+ +
var el = document.querySelector("div.user-panel.main input[name='login']");
+
+ +

Uwagi

+ +

Jeśli nie znaleziono dopasowań - zwraca null. W przeciwnym wypadku zwraca pierwszy pasujący element.

+ +

Jeśli selektor zawiera ID i to ID zostaje wielokrotnie błędnie użyte w dokumencie, zwracany jest pierwszy pasujący element.

+ +

Gdy podana grupa selektorów jest nieprawidłowa, zwrócony zostaje wyjątek SYNTAX_ERR.

+ +

querySelector() został wprowadzony w API Selektorów.

+ +

Przekazany do funkcji querySelector łańcuch znaków (string) musi być zgodny ze składnią CSS.

+ +

Zgodnie z API Selektorów pseudoklasy CSS nigdy nie zwrócą żadnego elementu.

+ +

Aby użyć ID lub selektorów niezgodnych ze składnią CSS (np. ze względu na niewłaściwe użycie dwukropka czy spacji) należy poprzedzić niezgodny znak ukośnikiem wstecznym (backslash). Z racji, że w JavaScript backslash jest używany jako znak ucieczki chcąc użyć go w stringu należy wpisać go podwójnie(jeden dla stringa JavaScriptu i drugi raz dla querySelector):

+ +
<div id="foo\bar"></div>
+<div id="foo:bar"></div>
+
+<script>
+  console.log('#foo\bar')               // "#fooar"
+  document.querySelector('#foo\bar')    // Nie pasuje do żadnego elementu
+
+  console.log('#foo\\bar')              // "#foo\bar"
+  console.log('#foo\\\\bar')            // "#foo\\bar"
+  document.querySelector('#foo\\\\bar') // Odnosi się do pierwszego diva
+
+  document.querySelector('#foo:bar')    // Nie pasuje do żadnego elementu
+  document.querySelector('#foo\\:bar')  // Odnosi się do drugiego diva
+</script>
+
+ +

Specyfikacje

+ + + + + + + + + + + + + + + + + + + +
SpecyfikacjaStatusKomentarz
{{SpecName("Selectors API Level 2", "#interface-definitions", "document.querySelector()")}}{{Spec2("Selectors API Level 2")}}
{{SpecName("Selectors API Level 1", "#interface-definitions", "document.querySelector()")}}{{Spec2("Selectors API Level 1")}}Definicja wstępna
+ +

Zgodność z przeglądarkami

+ +

{{CompatibilityTable()}}

+ +
+ + + + + + + + + + + + + + + + + + + +
CechaChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Wsparcie podstawowe13.5 (1.9.1)
+ {{bug(416317)}}
8103.2 (525.3)
+ {{Webkitbug("16587")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
CechaAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Wsparcie podstawowe2.1yes910.03.2
+
+ + + +

Zobacz także

+ + + + diff --git a/files/pl/web/api/document/referrer/index.html b/files/pl/web/api/document/referrer/index.html new file mode 100644 index 0000000000..0667be8e4c --- /dev/null +++ b/files/pl/web/api/document/referrer/index.html @@ -0,0 +1,22 @@ +--- +title: document.referrer +slug: Web/API/Document/referrer +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/referrer +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca URI strony, która przekierowała na bieżącą stronę.

+

Składnia

+
ciąg = document.referrer
+
+

Uwagi

+

Jeżeli użytkownik otworzył stronę bezpośrednio (nie poprzez odnośnik, ale np. za pomocą zakładki), wartością tej właściwości jest pusty ciąg.

+

Zauważ też, że właściwość ta zwraca tylko ciąg tekstowy, nie daje dostępu do DOM strony odsyłającej.

+

Specyfikacja

+

referrer

+

{{ languages( { "en": "en/DOM/document.referrer" } ) }}

diff --git a/files/pl/web/api/document/releasecapture/index.html b/files/pl/web/api/document/releasecapture/index.html new file mode 100644 index 0000000000..7585229fe5 --- /dev/null +++ b/files/pl/web/api/document/releasecapture/index.html @@ -0,0 +1,31 @@ +--- +title: Document.releaseCapture() +slug: Web/API/Document/releaseCapture +translation_of: Web/API/Document/releaseCapture +--- +
{{ ApiRef("DOM") }} {{gecko_minversion_header("2.0")}}
+ +
 
+ +

Zwalnia śledzenie myszy, jeśli śledzenie jest ustawione na jakimś elemencie wewnątrz dokumentu. Możesz włączyć śledzenie wywołując {{domxref("element.setCapture()")}}.

+ +

Składnia

+ +
document.releaseCapture()
+
+ +

Po zwolnieniu śledzenia, zdarzenia myszy nie będą przekierowywane do elementu dla którego śledzenie było włączone.

+ +

Przykład

+ +

Zobacz przykład przykład dla {{domxref("element.setCapture()")}}.

+ +

Specyfikacja

+ +

Oparta na implementacji Internet Explorera.

+ +

Zobacz także

+ + diff --git a/files/pl/web/api/document/stylesheets/index.html b/files/pl/web/api/document/stylesheets/index.html new file mode 100644 index 0000000000..4c8312b281 --- /dev/null +++ b/files/pl/web/api/document/stylesheets/index.html @@ -0,0 +1,19 @@ +--- +title: document.styleSheets +slug: Web/API/Document/styleSheets +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/DocumentOrShadowRoot/styleSheets +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Własność styleSheets zwraca listę obiektów stylesheet w bieżącym dokumencie.

+

Składnia

+
listaWęzłów = document.styleSheets
+
+

Specyfikacja

+

DOM Level 2.

+

{{ languages( { "en": "en/DOM/document.styleSheets", "ja": "ja/DOM/document.styleSheets" } ) }}

diff --git a/files/pl/web/api/document/title/index.html b/files/pl/web/api/document/title/index.html new file mode 100644 index 0000000000..0a379426e5 --- /dev/null +++ b/files/pl/web/api/document/title/index.html @@ -0,0 +1,45 @@ +--- +title: document.title +slug: Web/API/Document/title +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/title +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Pobiera lub ustawia tytuł dokumentu.

+

Składnia

+
tytul =document.title;
+
+ +
document.title =nowyTytul;
+
+ +

Przykład

+
<html>
+<head>
+ <title>Hello World!</title>
+</head>
+<body>
+ <script>
+ alert(document.title); // wyswietla "Hello World!"
+ document.title = "Goodbye World!";
+ alert(document.title); // wyswietla "Goodbye World!"
+ </script>
+</body>
+</html>
+
+

Uwagi

+

Własność ta ma zastosowanie w HTML, SVG, XUL i innych dokumentach w Gecko.

+

Dla dokumentów HTML początkową wartością document.title jest zawartość tekstowa elementu <title>. Dla XUL-a jest to wartość atrybutu {{ XULAttr("title") }} elementu {{ XULElem("window") }} lub innego elementu XUL najwyższego poziomu.

+

W XUL-u próba dostępu do document.title zanim jeszcze dokument zostanie w pełni załadowany może skutkować niepożądanym zachowaniem (document.title może zwrócić pusty łańcuch znaków, a ustawienie document.title może nie mieć żadnego efektu).

+

Specyfikacja

+

DOM Level 2 HTML: document.title

+

{{ languages( { "en": "en/DOM/document.title" } ) }}

diff --git a/files/pl/web/api/document/url/index.html b/files/pl/web/api/document/url/index.html new file mode 100644 index 0000000000..90bb037e8b --- /dev/null +++ b/files/pl/web/api/document/url/index.html @@ -0,0 +1,25 @@ +--- +title: document.URL +slug: Web/API/Document/URL +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/URL +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca URL bieżącego dokumentu.

+

Składnia

+
ciąg = document.URL
+
+

Przykład

+
var currentURL = document.URL;
+alert(currentURL);
+
+

Uwagi

+

URL ma zastąpić używaną w DOM Level 0 własność document.location.href. Jednakże, w przeciwieństwie do niej, document.URL nie można ustawiać.

+

Specyfikacja

+

DOM Level 2 HTML: URL

+

{{ languages( { "en": "en/DOM/document.URL", "es": "es/DOM/document.URL", "ja": "ja/DOM/document.URL" } ) }}

diff --git a/files/pl/web/api/document/vlinkcolor/index.html b/files/pl/web/api/document/vlinkcolor/index.html new file mode 100644 index 0000000000..b33a53c482 --- /dev/null +++ b/files/pl/web/api/document/vlinkcolor/index.html @@ -0,0 +1,29 @@ +--- +title: document.vlinkColor +slug: Web/API/Document/vlinkColor +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/vlinkColor +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca/ustawia kolor odwiedzonych linków w dokumencie.

+

Składnia

+
kolor = document.vlinkColor
+document.vlinkColor =kolor
+
+

Parametry

+ +

Uwagi

+

Domyślną wartością tej własności jest + + purple + .

+

Specyfikacja

+

DOM Level 0 - brak w specyfikacji.

+

{{ languages( { "en": "en/DOM/document.vlinkColor" } ) }}

diff --git a/files/pl/web/api/document/width/index.html b/files/pl/web/api/document/width/index.html new file mode 100644 index 0000000000..af36011079 --- /dev/null +++ b/files/pl/web/api/document/width/index.html @@ -0,0 +1,28 @@ +--- +title: document.width +slug: Web/API/Document/width +tags: + - DOM + - DOM_0 + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/width +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zwraca szerokość bieżącego dokumentu w pikselach.

+

Nie obsługiwana przez IE.

+

Składnia

+
piksele = document.width
+
+

Przykład

+
function init() {
+  alert("Szerokość dokumentu wynosi " + document.width + " pikseli.");
+}
+
+

Uwagi

+

Zobacz także DOM:document.height.

+

Specyfikacja

+

{{ DOM0() }}

+

{{ languages( { "en": "en/DOM/document.width" } ) }}

diff --git a/files/pl/web/api/document/write/index.html b/files/pl/web/api/document/write/index.html new file mode 100644 index 0000000000..24daccf070 --- /dev/null +++ b/files/pl/web/api/document/write/index.html @@ -0,0 +1,38 @@ +--- +title: document.write +slug: Web/API/Document/write +tags: + - DOM + - Dokumentacja_Gecko_DOM + - Gecko + - Wszystkie_kategorie +translation_of: Web/API/Document/write +--- +

{{ ApiRef() }}

+

Podsumowanie

+

Zapisuje ciąg tekstu w strumieniu dokumentu otwartym przez document.open.

+

Składnia

+
document.write(tekst)
+
+

Parametry

+ +

Przykład

+
document.open();
+document.write("<h1>witam!</h1>");
+document.close();
+
+

Uwagi

+

Zapis do dokumentu, który już się załadował, bez wywoływania document.open spowoduje automatyczne przeprowadzenie document.open. Zaleca się wywołanie document.close po skończeniu zapisu, aby poinformować przeglądarkę, by zakończyła ładowanie strony. Tekst, który zapisujesz, jest parsowany i trafia do modelu struktury dokumentu. W poniższym przykładzie element H1 staje się węzłem. Jeżeli wywołanie document.write() zostało zagnieżdżone bezpośrednio w kodzie HTML, nie spowoduje ono uruchomienia document.open. Np.:

+
 <div>
+  <script type="text/javascript">
+    document.write("<h1>Main title</h1>")
+  </script>
+ </div>
+
+

Specyfikacja

+

write

+
+  
+

{{ languages( { "en": "en/DOM/document.write", "fr": "fr/DOM/document.write", "ja": "ja/DOM/document.write" } ) }}

diff --git a/files/pl/web/api/document/writeln/index.html b/files/pl/web/api/document/writeln/index.html new file mode 100644 index 0000000000..f70d4f72a4 --- /dev/null +++ b/files/pl/web/api/document/writeln/index.html @@ -0,0 +1,41 @@ +--- +title: document.writeln +slug: Web/API/Document/writeln +tags: + - DOM + - Wszystkie_kategorie +translation_of: Web/API/Document/writeln +--- +

{{APIRef("DOM")}}

+ +

Podsumowanie

+ +

Zapisuje w dokumencie ciąg tekstu, a po nim znak nowej linii.

+ +

Składnia

+ +
document.writeln(linia)
+
+ +

Parametry

+ + + +

Przykład

+ +
document.writeln("<p>podaj hasło:</p>");
+
+ +

Uwagi

+ +

document.writeln nie różni się niczym od document.write, poza tym, że dodaje na końcu znak nowego wiersza.

+ +

Specyfikacja

+ +

writeln

+ +
 
+ +

{{ languages( { "en": "en/DOM/document.writeln", "ja": "ja/DOM/document.writeln" } ) }}

-- cgit v1.2.3-54-g00ecf