PDA

View Full Version : Dynamic Ajax Content & Lightbox 2.0



Durlak
07-03-2006, 06:35 PM
Dynamic Ajax Content
http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
Lightbox image viewer 2.0
http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

Hello, I have a problem mixing the two scripts in IE. In firefox works perfectly, but in IE a get a error messaje saying that the page can't be displayed.

Here's the litle modificacion I did to the code.

<script type="text/javascript">

/***********************************************
* Dynamic Ajax Content- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
initLightbox()
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

I just added initLightbox function to the ajax code.


I don't know why I keep getting the same error. Please Help Me.
Thanks
Durlak