08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

276<br />

CHAPTER 11 ■ <strong>AJAX</strong> APPLICATIONS AND EMPOWERING THE WEB USER EXPERIENCE<br />

}<br />

cachedAjaxRequest = new ActiveXObject("Microsoft.XMLHTTP");<br />

}<br />

ShowPic(currentPic);<br />

function GetPic(thisPic)<br />

{<br />

}<br />

theCachedURL = "GetPicture.aspxpicid=" + thisPic;<br />

cachedAjaxRequest.open("GET", theCachedURL);<br />

cachedAjaxRequest.send();<br />

function ShowPic(thisPic)<br />

{<br />

theURL = "GetPicture.aspxpicid=" + thisPic;<br />

ajaxRequest.open("GET", theURL);<br />

ajaxRequest.onreadystatechange=DisplayPic;<br />

ajaxRequest.send();<br />

}<br />

function DisplayPic()<br />

{<br />

var divPic = document.getElementById("pic");<br />

if(ajaxRequest.readyState == 4)<br />

{<br />

divPic.innerHTML = "";<br />

}<br />

GetPic(currentPic+1);<br />

GetPic(currentPic+2);<br />

GetPic(currentPic-1);<br />

GetPic(currentPic-2);<br />

}<br />

function DoPrev()<br />

{

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

Saved successfully!

Ooh no, something went wrong!