VB icon

AJAX with VB

Email
Submitted on: 2/17/2015 12:25:00 PM
By: M.Mehdi (from psc cd)  
Level: Beginner
User Rating: By 3 Users
Compatibility: VB 5.0, VB 6.0, ASP (Active Server Pages)
Views: 1233
 
     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.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: AJAX with VB
' Description: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.
' By: M.Mehdi (from psc cd)
'**************************************

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


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.