HTML and CSS Reference
In-Depth Information
The Ajax Request File—“AjaxRequest.js”
EXAMPLE 18.8
/* Check browser type and create ajax request object
Put this function in an external .js file and use it for your
Ajax programs. Fully explained in Example 18.1. */
1
function CreateRequestObject() {
2
var ajaxRequest; // The variable that makes Ajax possible!
3
try{
// Opera 8.0+, Firefox, Safari
4
ajaxRequest = new XMLHttpRequest();
// Create the object
}
catch (e){
// Internet Explorer Browsers
try{
5
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try{
6
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
7
return false;
}
}
}
8
return ajaxRequest;
} //End function
The CSS File—“ajaxTextFile.css”
EXAMPLE 18.9
body{background-color:aliceblue;}
.divStyle {
margin-left:5px;
margin-right:200px;
border-style:solid;
border-color:blue;
font-size:150%;
}
Search WWH ::




Custom Search