W3 Updates, HTML, XHTML, CSS, JavaScript, AJAX, XML, PHP, Ruby, PHP Frameworks

ASP Procedures

September 4th, 2011

In ASP you can call a JavaScript procedure from a VBScript and vice versa. Procedures The ASP source code can contain procedures and functions: Example <html> <head> <% sub vbproc(num1,num2) response.write(num1*num2) end sub %> </head> <body> <p>Result: <%call vbproc(3,4)%></p> </body> </html> Show example » Insert the <%@ language=”language” %> line above the <html> tag to [...]

Read More >>

Author: Categories: ASP Tags:

ASP Session Object

September 4th, 2011
Tip

A Session object stores information about, or change settings for a user session. The Session object When you are working with an application on your computer, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you open the [...]

Read More >>

Author: Categories: ASP Tags:

ASP Variables

September 4th, 2011

Lifetime of Variables A variable declared outside a procedure can be accessed and changed by any script in the ASP file. A variable declared inside a procedure is created and destroyed every time the procedure is executed. No scripts outside the procedure can access or change the variable. To declare variables accessible to more than [...]

Read More >>

Author: Categories: ASP Tags:

Create an XMLHttpRequest Object

August 8th, 2011

The keystone of AJAX is the XMLHttpRequest object. The XMLHttpRequest Object All modern browsers support the XMLHttpRequest object (IE5 and IE6 uses an ActiveXObject). The XMLHttpRequest object is used to exchange data with a server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole [...]

Read More >>

Author: Categories: AJAX Tags:

Send a Request To a Server

August 8th, 2011

The XMLHttpRequest object is used to exchange data with a server. Send a Request To a Server To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object: xmlhttp.open(“GET”,”ajax_info.txt”,true); xmlhttp.send(); Method Description open(method,url,async) Specifies the type of request, the URL, and if the request should be handled asynchronously [...]

Read More >>

Author: Categories: AJAX Tags: ,

The onreadystatechange Event

August 8th, 2011

The onreadystatechange event When a request to a server is sent, we want to perform some actions based on the response. The onreadystatechange event is triggered every time the readyState changes. The readyState property holds the status of the XMLHttpRequest. Three important properties of the XMLHttpRequest object: Property Description onreadystatechange Stores a function (or the [...]

Read More >>

Author: Categories: AJAX Tags:

Server Response

August 8th, 2011

Server Response To get the response from a server, use the responseText or responseXML property of the XMLHttpRequest object. Property Description responseText get the response data as a string responseXML get the response data as XML data The responseText Property If the response from the server is not XML, use the responseText property. The responseText [...]

Read More >>

Author: Categories: AJAX Tags:

ASP/PHP Example

August 8th, 2011

AJAX is used to create more interactive applications. AJAX ASP/PHP Example The following example will demonstrate how a web page can communicate with a web server while a user type characters in an input field: Example Start typing a name in the input field below: First name:  Suggestions: Try it yourself » Example Explained – [...]

Read More >>

Author: Categories: AJAX Tags: , ,

XML Files

July 16th, 2011

We can bind an XML file to a list control. An XML File Here is an XML file named “countries.xml”: <?xml version=”1.0″ encoding=”ISO-8859-1″?> <countries> <country> <text>Norway</text> <value>N</value> </country> <country> <text>Sweden</text> <value>S</value> </country> <country> <text>France</text> <value>F</value> </country> <country> <text>Italy</text> <value>I</value> </country> </countries> Take a look at the XML file: countries.xml Bind a DataSet to a List Control [...]

Read More >>

Author: Categories: ASP.NET Tags:

The SortedList Object

July 16th, 2011

The SortedList Object The SortedList object contains items in key/value pairs. A SortedList object automatically sort the items in alphabetic or numeric order. Items are added to the SortedList with the Add() method. A SortedList can be sized to its final size with the TrimToSize() method. The following code creates a SortedList named mycountries and [...]

Read More >>

Author: Categories: ASP.NET Tags: