robs
12-23-2008, 03:42 PM
Hello everyone,
i have a weird problem.
I'm trying to run a modified lightbox version from a page loaded through ajax. The lightbox runs fine if i embed the page with php using the include function. But if i load exactly the same page via ajax it wont work for some reason.
Here is my ajax code:
function ShowNewReleases(startfrom) {
var ajaxRequest;
try{
ajaxRequest = new XMLHttpRequest();
} catch (e){
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
alert("Your browser broke!");
return false;
}
}
}
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('DivNewReleases');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
else {
var ajaxDisplay = document.getElementById('DivNewReleases');
ajaxDisplay.innerHTML = '<br><br><br><br><br><br><image src=\"php/ajax-loader.gif\">';
}
}
ajaxRequest.open("GET", "php/main.php?startfrom=" + startfrom, true);
ajaxRequest.send(null);
}
you can see a live example of this here:
http://www.it-leaked.com/v4alpha/
you'll notice that the box works fine when clicking on the + button on the mainpage, but if you click on the back button and then on the + on the loaded page the lightbox wont show up :(
if you need any other files let me know
thanks for the help i hope someone can give me a hint
i have a weird problem.
I'm trying to run a modified lightbox version from a page loaded through ajax. The lightbox runs fine if i embed the page with php using the include function. But if i load exactly the same page via ajax it wont work for some reason.
Here is my ajax code:
function ShowNewReleases(startfrom) {
var ajaxRequest;
try{
ajaxRequest = new XMLHttpRequest();
} catch (e){
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
alert("Your browser broke!");
return false;
}
}
}
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('DivNewReleases');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
else {
var ajaxDisplay = document.getElementById('DivNewReleases');
ajaxDisplay.innerHTML = '<br><br><br><br><br><br><image src=\"php/ajax-loader.gif\">';
}
}
ajaxRequest.open("GET", "php/main.php?startfrom=" + startfrom, true);
ajaxRequest.send(null);
}
you can see a live example of this here:
http://www.it-leaked.com/v4alpha/
you'll notice that the box works fine when clicking on the + button on the mainpage, but if you click on the back button and then on the + on the loaded page the lightbox wont show up :(
if you need any other files let me know
thanks for the help i hope someone can give me a hint