Advertisement
6_2008-2009 Coding Standards #214594

AJAX with VB

Working of AJAX with VB. When you want to get data directly from server. Very useful in ASP Applications, when you need to create dynamic and interactive pages without refreshing page and without making a roundtrip to server. This was made popular in 2005 by Google Suggest. Google Suggest is using the XMLHttpRequest of Java Script object to create a very dynamic web interface: When you start typing in Google's search box, a JavaScript sends the letters off to a server and the server returns a list of suggestions.

AI

Podsumowanie AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kod źródłowy
original-source
Private Sub Command1_Click()
  Dim objXml
  Set objXml = CreateObject("Msxml2.XMLHTTP")
  objXml.open "GET", "http://www.w3schools.com/ajax/time.asp", True
  objXml.send (Null)
  If Not objXml Is Nothing Then
ReGet:
    DoEvents
    If objXml.readyState = 4 Then
      MsgBox "Time at Web is: " & objXml.responseText
    ElseIf objXml.readyState = 1 Then
      GoTo ReGet
    End If
  End If
  Set objXml = Nothing
End Sub
Oryginalne komentarze (3)
Odzyskane z Wayback Machine