Search Tools Links Login

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.

Original Author: M.Mehdi

Code

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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 123 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.