Here is my issue. I have a php file… I click on the link, ajax generates a lightbox, I close the lightbox, then I click the link again and I am redirected to a new php file rather than loading the ajax.
Here is my lightbox JS. Should this cause a conflict?
Something is wrong with your close function. We have to see the close function code in order to diagnose what the problem is. Hehe.
P.S. Does the open lightbox link disappear once the lightbox is open? If it doesn’t then try clicking the lightbox button once the lightbox is already open, and see if it redirects you. If it does redirect you, then we know there is a problem with the open function.
This isn’t tested, but perhaps using JQuery native methods for the onload callback and ajax will solve the issue.
$(document).ready(function() {
$('#personalPartners').click(function() {
$.ajax({
url: 'partners.php?u=<?php echo $username ; ?>&ajax=true'
,dataType:'html'
,success:function(data,status,xhr) {
$('body').html(data);
}
,error:function(xhr,status,error) {
alert('An error has occurred with the request.');
}
});
});
});
If your using JQuery you might as well take full advantage of what it has to offer.
Edit:
Is JavaScript included in the AJAX response? If so than you need to manually eval() the contents of every script tag. innerHTML does not execute JavaScript. However, JQuery html() does.