loading a href's content into a shadowbox using .load() HELP!!!

Posted by kielie on Stack Overflow See other posts from Stack Overflow or by kielie
Published on 2010-05-09T16:29:22Z Indexed on 2010/05/09 16:48 UTC
Read the original article Hit count: 259

Filed under:
|
|
<script type="text/javascript">
    $(function() {
        $('#wp-calendar a').click(function(event) {
            event.preventDefault();

            var url = $(this).attr('href') + ' #content';

            var loaded = Shadowbox.load(url);

            Shadowbox.open({
                content:    loaded,
                player:     "html",
                title:      "<?php the_title(); ?>",
                height:     300,
                width:      470,
            });
        });
    });
</script>

That is the code I am using to try and display content in a shadowbox, I am using the default wordpress calendar and with jQuery/AJAX (if I am not mistaken) adding this click event to every link in the calendar, so that when a link is clicked, the content is loaded and displayed in a shadowbox instead of opening on a new page.

When I click on one of the links all I get inside of the shadowbox is "undefined".

As I am sure you can see in my code, I am still very new to this, so any help or pointers would be appreciated.

Thanx in advance!

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about jQuery