Ajax in Hindi Request




XMLHttpRequest Object निम्न Methods को Server से Interact करने की अनुमति है.

Property Description
open(method, url, boolean) Method URL और Boolean के प्रकार को Specifie करता है यदि Asynchronous या Handle Synchronous से False की तुलना में True है.
  • Method: Request के Type प्राप्त करे GET और POST करें.

  • Url: server पर File का स्थान पथ के साथ है.

  • Boolean: True (Asynchronous) या False (Synchronous).

  • Optionally रूप से आप Login और Password की Wish को Arguments में जोड़ सकते हैं.

send("string") String: केवल POST Method Request का उपयोग करता हैं.

GET or POST Method

  • GET POST से सरल और तेज है इसलिए अधिकतर GET का उपयोग करते हैं.

  • Server पर बड़ी मात्रा मे Data भेजने पर POST Request का इस्तेमाल होता है Update मे Server पर भी शामिल होता है POST GET से सुरक्षित और मजबूत तरीका है.

  • Server पर बड़ी मात्रा मे Data भेजने पर POST Request का इस्तेमाल होता है.

GET Method

Syntax

xmlhttp.open("GET", url, true)  // xmlhttp is variable name
xmlhttp.send()

For Example
req.open("GET", "ajax_demo.txt", true); // req is variable name
req.send(null);

Post Method

Syntax

xmlhttp.open("POST", url, true)   // xmlhttp is variable name
xmlhttp.send(String)

For Example
req.open("POST", "ajax_demo.txt", true); // req is variable name
req.send("hitesh");