Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

em linha

Home Códigos de fonte E-Livros Downloads Contatar-nos Sobre nós

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting


Pedido do HTTP de XML
Previous Next



Objeto do pedido do HTTP de XML

Plataforma:

Mozilla em todas as plataformas, em Internet Explorer em Windows, Safari no Mac OS-X, em Konqueror em KDE, em IceBrowser em Java, e em ópera em todas as plataformas including Symbian fornece um método para o Javascript do lado do cliente para fazer pedidos do HTTP. Do humble começa como um objeto estranhamente nomeado com poucos admiradores, ele floresceu para ser a tecnologia do núcleo em algo AJAX chamado [1].




Por que objeto do pedido do HTTP de XML?

O objeto do pedido do HTTP de XML não é limitado a ser usado com XML, ele pode pedir ou emitir nenhum tipo de original, embora tratar dos córregos binários possa ser problematical no Javascript.


Que é um pedido do HTTP?

Com o pedido do HTTP um Web page faz um pedido começar uma resposta de um web server - sem recarregar a página. O usuário permanecerá na mesma página, e ou não observarão que os certificados puderam pedir páginas, ou emitem dados a um usuário no fundo.


Através do objeto de XMLHttpRequest, um colaborador da correia fotorreceptora pode mudar uma página com dados do usuário depois que a página carregou.

Google sugere está usando o objeto de XMLHttpRequest criar uma relação muito dinâmica da correia fotorreceptora: Quando você começa datilografar na caixa da busca de Google, um Javascript emite as letras fora a um usuário e o usuário retorna uma lista das sugestões.




Se objeto de XMLHttpRequest um padrão de W3C?

O No., objeto de XMLHttpRequest não é um padrão de W3C.

O nível 3 de W3C DOM “carga e excepto” a especificação contem alguma funcionalidade similar, mas estes não são executados em nenhuns browsers ainda. Assim, no momento em que o objeto de XMLHttpRequest necessitou emitir um pedido do HTTP de um browser.




Como criar um objeto de XMLHttpRequest

No Internet Explorer, dependendo da versão de MSXML instalou-o críam o objeto usando ActiveXObject novo (“Msxml2.XMLHTTP”) ou ActiveXObject novo (“Microsoft.XMLHTTP”). Em Mozilla e em Safari você usa usos novos de XMLHttpRequest () IceBrowser contudo um outro método o método de window.createRequest ().

Isto significa que você necessita mostrar o certificado diferente aos browsers diferentes, como que trabalhos em um, erro da vontade em outro. O certificado abaixo faz este, e se não for suportada, a variável está ajustada a falso para permitir mensagens e a recuperação apropriadas de erro com degradar a uns métodos mais normais da transação do HTTP quando o objeto não está disponível. Esta degradação é importante, mesmo no IE que os objetos podem frequentemente ser obstruídos pelos ajustes ligeiramente levantados da segurança (popular devido aos furos geralmente explorados naturalmente). Onde possível degradar, algumas aproximações são falados aproximadamente abaixo, se você não puder realmente, mim recomendaria fornecer um aswell alternativo da página. GMail por exemplo disse que estarão fornecendo uma versão mais menos exijindo no futuro, esperançosamente com nenhum Javascript em tudo, degradação cheia.

 


var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp=false;
}
}
if (!xmlhttp && window.createRequest) {
try {
xmlhttp = window.createRequest();
} catch (e) {
xmlhttp=false;
}
}
 


Para fazer um pedido do HTTP?

Para fazer um HTTP pedi-lo dizer ao objeto do pedido do HTTP de XML que sorte do pedido do HTTP você quer e que URL você quer pedir. Fornecer uma função a ser chamada quando como o pedido está sendo feito, e finalmente que, (se algum) informação que você quer emitido longitudinalmente no corpo do pedido.

O seguinte certificado faz um pedido COMEÇAR para o Relative URL “text.txt” (relativo à página de chamada) que fornece a função, que verifica a propriedade do readyState se tem chamado cada vez e quando tem o valor 4 - significando a carga está completa, indica o responseText ao usuário com um alerta.

 

xmlhttp.open("GET", "test.txt",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
alert(xmlhttp.responseText)
}
}
xmlhttp.send(null)
 




A referência do objeto de XMLHttpRequest

Métodos

Method Description
abort() Cancels the current request
getAllResponseHeaders() Returns the complete set of http headers as a string
getResponseHeader("headername") Returns the value of the specified http header
open("method","URL",async,"uname","pswd") Specifies the method, URL, and other optional attributes of a request

The method parameter can have a value of "GET", "POST", or "PUT" (use "GET" when requesting data and use "POST" when sending data (especially if the length of the data is greater than 512 bytes.

The URL parameter may be either a relative or complete URL.

The async parameter specifies whether the request should be handled asynchronously or not. true means that script processing carries on after the send() method, without waiting for a response. false means that the script waits for a response before continuing script processing

send(content) Sends the request
setRequestHeader("label","value") Adds a label/value pair to the http header to be sent

Propriedades

Property Description
onreadystatechange An event handler for an event that fires at every state change
readyState Returns the state of the object:

0 = uninitialized
1 = loading
2 = loaded
3 = interactive
4 = complete

responseText Returns the response as a string
responseXML

Returns the response as XML. This property returns an XML document object, which can be examined and parsed using W3C DOM node tree methods and properties

status Returns the status as a number (e.g. 404 for "Not Found" or 200 for "OK")
statusText Returns the status as a string (e.g. "Not Found" or "OK")




Previous Next

Keywords: xmlhttprequest object, xmlhttprequest ajax, javascript xmlhttprequest, xml http request, xml http request object, http content type, http content length, asp net http request, http keep alive, http user agent, http web server, asp net xml, request content length, internet explorer xml, request user agent, request content type, http internet explorer, request asp net, http asp net, http xml request.


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
HLML Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizes
Oracle Quiz
MySQL Quiz
Operating System Quizes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizes
Testing Quiz
Firewalls Quiz
SAP Module Quizes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizes
Corba Quiz
Networking Quiz
Microsoft Office Quizes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizes
Financial Accounting Quiz
Managerial Accounting Quiz

Privacy Policy
Copyright © 2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved.