Samouczek XML

Strona główna XML Wprowadzenie do XML XML Jak używać Drzewo XML Składnia XML Elementy XML Atrybuty XML Przestrzenie nazw XML Wyświetlacz XML Żądanie HTTP XML Parser XML XML DOM XML XPath XML XSLT XML XQuery XML XLink Walidator XML XML DTD Schemat XML Serwer XML Przykłady XML Quiz XML Certyfikat XML

XML AJAX

Wprowadzenie do AJAX AJAX XMLHttp Żądanie AJAX Odpowiedź AJAX Plik XML AJAX AJAX PHP ASP AJAX Baza danych AJAX Aplikacje AJAX Przykłady AJAX

XML DOM

Wprowadzenie do DOM Węzły DOM Dostęp do DOM Informacje o węźle DOM Lista węzłów DOM Przechodzenie DOM Nawigacja DOM DOM Uzyskaj wartości Zmiana węzłów DOM DOM Usuń węzły DOM Zamień węzły DOM Utwórz węzły DOM Dodaj węzły Węzły klonowania DOM Przykłady DOM

Samouczek XPath

Wprowadzenie do XPath Węzły XPath Składnia XPath Osie XPath Operatorzy XPath Przykłady XPath

Samouczek XSLT

Wprowadzenie XSLT Języki XSL Transformacja XSLT XSLT <szablon> XSLT <wartość-z> XSLT <dla każdego> XSLT <sortuj> XSLT <jeśli> XSLT <wybierz> XSLT Zastosuj XSLT na kliencie XSLT na serwerze XSLT Edytuj XML Przykłady XSLT

Samouczek XQuery

Wprowadzenie do XQuery Przykład XQuery XQuery FLWOR XQuery HTML Warunki XQuery Składnia XQuery XQuery Dodaj XQuery Wybierz Funkcje XQuery

XML DTD

Wprowadzenie do DTD Bloki konstrukcyjne DTD Elementy DTD Atrybuty DTD Elementy DTD a Attr Jednostki DTD Przykłady DTD

Schemat XSD

Wprowadzenie do XSD XSD Jak to zrobić XSD <schemat> Elementy XSD Atrybuty XSD Ograniczenia XSD

Kompleks XSD

Elementy XSD XSD Pusty Tylko elementy XSD Tylko tekst XSD Mieszane XSD Wskaźniki XSD XSD <dowolny> XSD <dowolnyAtrybut> Zastąpienie XSD Przykład XSD

Dane XSD

XSD ciąg Data XSD Numeryczne XSD XSD Różne Odniesienie XSD

Usługi internetowe

Usługi XML XML WSDL MYDŁO XML XML RDF XML RSS

Bibliografia

Typy węzłów DOM Węzeł DOM Lista węzłów DOM DOM NamedNodeMap Dokument DOM Element DOM Atrybut DOM Tekst DOM DOM CDATA Komentarz DOM DOM XMLHttpRequest Analizator DOM Elementy XSLT Funkcje XSLT/XPath

Obiekt XMLHttpRequest _


Za pomocą obiektu XMLHttpRequest możesz aktualizować części strony internetowej bez ponownego ładowania całej strony.


Spróbuj sam - przykłady


Utwórz prosty XMLHttpRequest i pobierz dane z pliku TXT.


Pobierz informacje z nagłówka zasobu (pliku).


Pobierz określone informacje nagłówka zasobu (pliku).


Jak strona internetowa może komunikować się z serwerem sieciowym, gdy użytkownik wpisuje znaki w polu wejściowym.


Jak strona internetowa może pobierać informacje z bazy danych za pomocą obiektu XMLHttpRequest.


Utwórz XMLHttpRequest, aby pobrać dane z pliku XML i wyświetlić dane w tabeli HTML.


Obiekt XMLHttpRequest

Obiekt XMLHttpRequest służy do zakulisowej wymiany danych z serwerem.

Obiekt XMLHttpRequest to marzenie deweloperów , ponieważ możesz:

  • Zaktualizuj stronę internetową bez ponownego ładowania strony
  • Żądaj danych z serwera po załadowaniu strony
  • Odbierz dane z serwera po załadowaniu strony
  • Wysyłaj dane do serwera w tle


Metody obiektów XMLHttpRequest

Method Description
abort() Cancels the current request
getAllResponseHeaders() Returns header information
getResponseHeader() Returns specific header information
open(method,url,async,uname,pswd) Specifies the type of request, the URL, if the request should be handled asynchronously or not, and other optional attributes of a request

method: the type of request: GET or POST
url: the location of the file on the server
async: true (asynchronous) or false (synchronous)
send(string) send(string) Sends the request off to the server.

string: Only used for POST requests
setRequestHeader() Adds a label/value pair to the header to be sent

Właściwości obiektu XMLHttpRequest

Property Description
onreadystatechange Stores a function (or the name of a function) to be called automatically each time the readyState property changes
readyState Holds the status of the XMLHttpRequest. Changes from 0 to 4:
0: request not initialized
1: server connection established
2: request received
3: processing request
4: request finished and response is ready
responseText Returns the response data as a string
responseXML Returns the response data as XML data
status Returns the status-number (e.g. "404" for "Not Found" or "200" for "OK")
statusText Returns the status-text (e.g. "Not Found" or "OK")