tags:

views:

36

answers:

2

I am sending the following variable to the jQiery load method, expecting only the hashtagged div in return, instead I am getting the whole site

url: http://localhost/createstudios/videos/?vimeo=15741581#sidebar

function:

   function mf_ajax_load_new_content(url, div){
            //$('#ajax_loader').clone().prependTo('#main-content-area').show();
            $(div).animate({opacity:0.1},500,function(){
                $(this).children().remove();

                $(this).parent().load(url+div, function() {
                    $(this).animate({opacity:1},500);
                });
            })
    }

mf_ajax_load_new_content($(this).attr('href'), "#sidebar");
+1  A: 

You need a space in there, like this:

$(this).parent().load(url+" "+div, function() {

Without the space you're getting "page.html#sidebar" which isn't the "url selector" format you're after, the hash is completely discarded. Add the space to get the desired effect.

Nick Craver
A: 

try mf_ajax_load_new_content($(this).attr('href'), " #sidebar");

I believe you need that space. Also your url won't help us as it is on your localhost :)

lnrbob
yeah, only put the URL up to show it's form. No need to actually use it.
Mild Fuzz