13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Fundamental Ajax<br />

867<br />

Listing 34.3<br />

Continued<br />

font-size: 12pt;<br />

font-weight: bold;<br />

}<br />

<br />

<br />

<br />

var myReq = getXMLHTTPRequest();<br />

<br />

<br />

<br />

<br />

Ajax Demonstration<br />

Place your mouse over the box below<br />

to get the current server time.<br />

The page will not refresh; only the contents of the box<br />

will change.<br />

<br />

<br />

<br />

<br />

The listing begins with the XHTML declaration, followed by the opening <strong>and</strong><br />

tags.Within the head area of the document, place the style sheet entries within<br />

the tag pair. Only two are defined here: the format of everything<br />

within the body tag, <strong>and</strong> the format of the element using the displaybox class.The<br />

displaybox class is defined as a 300-pixel wide, 50-pixel high white box with a black<br />

border. Additionally, everything in it will be in a bold 12-point font.<br />

After the style sheet entries, but still within the head element, is the link to the<br />

JavaScript library of functions:<br />

<br />

This is followed by the creation of a new XMLHTTPRequest object called myReq:<br />

<br />

var myReq = getXMLHTTPRequest();<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!