VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



AJAX with VB

by M.Mehdi (5 Submissions)
Category: Coding Standards
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

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.

Rate AJAX with VB

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

Download this snippet    Add to My Saved Code

AJAX with VB Comments

No comments have been posted about AJAX with VB. Why not be the first to post a comment about AJAX with VB.

Post your comment

Subject:
Message:
0/1000 characters