[jQuery] Shadowbox and AJAX

2008-09-22 Thread Ruby

I am trying to make a page that is using the ajax call on an XML file.
The trouble I am having is trying to get shadowbox to work. I need
some help please.

Here is the code so far

script type=text/javascript
!--
var $j = jQuery.noConflict();


$j(document).ready(function(){

$j.ajax({
type: GET,
url: Events.xml,
dataType: xml,
success: function(xml) {

$j(xml).find('event').each(function(){
var EventTitle = 
$j(this).find('title').text();
var StartDate = 
$j(this).find('start').text();
var EndDate = 
$j(this).find('end').text();
var EventDesc = 
$j(this).find('description').text();
var url = 
$j(this).find('url').text();
var trigger = 
$j(this).find('trigger').text();

if (url != ' ') {
$j('div 
class=StoreEvent/div').html('div
class=StoreEventTitle'+EventTitle+'/div'+EventDesc+'a href='+url
+' rel=shadowbox class=EventLink'+trigger+'/
a').appendTo('.StoreEventGeneric');

} else {
$j('div 
class=StoreEvent/div').html('div
class=StoreEventTitle'+EventTitle+'/div'+EventDesc+'
').appendTo('.StoreEventGeneric');
}

});
}
});

});

--
/script


[jQuery] Shadowbox and ajax-returned content?

2008-01-29 Thread Bruce MacKay

Hello all/Michael,

I'm wanting to use Shadowbox in an application where the content of 
the page is being changed via AJAX


I have added Shadow.init(); into the callback function that is fired 
when the page's content is repopulated.   From the generated view of 
the source code, the

div id=shadowbox_overlay/div 
tags are present, so presumably the Shadow.init() is being fired. 
However, this doesn't seem to be enough as the Shadowbox functions 
are not firing on the new content. I've saved one of these pages as a 
standalone HTML page and the Shadowbox functionality works as 
expected, so apparently I'm not rebinding (if that's the correct 
word) the new content to Shadowbox.


Any idea/suggestion to allow me to achieve what I'm seeking here?

Thanks

Bruce