asual / jquery-address

jQuery Address - Deep linking for the masses
http://www.asual.com/jquery/address
GNU General Public License v2.0
814 stars 172 forks source link

Problems with links inside already loaded divs #16

Open walteen opened 14 years ago

walteen commented 14 years ago

Hi! I'm new here.. Well, all another links that are outside of the main container where jquery-address loads works great!

But when I click on the links that are inside of the container, the plugin seems not to work. I tried using .live() and .delegate() methods like this:

$(document).ready(function(){ $.address.crawlable('true') function loadURL(url){ if(url !='#'){ $("#conteudo").load(url) $("#conteudo").empty().html("

Carregando...
") } } $.address.change(function(event){ if (($("div.ad-preloads").length)&&($("div.ad-preloads").is(":visible")==true)){ $("div.ad-preloads").hide() } $("#conteudo").load($('[rel=address:'+event.value+']').attr('href')) $("#conteudo").empty().html("
Carregando...
")

})
    $('a').live('click',function(){
        loadURL($(this).attr('href'));
    });

})

Some sugestions?

Sorry for my bad English...

bhellman1 commented 14 years ago

I;m having the same issue. did you ever figure it out?

A973C commented 11 years ago

Hi! I'm facing the same issue and cant' find a workaround for this. On click, content is correctly loaded but not on refreshed page. I'm using this tutorial : http://www.thetutorialblog.com/jquery/deep-linking-with-jquery/

/*<![CDATA[*/
$("document").ready(function(){

    function loadURL(url) {
        console.log("loadURL: " + url);
        $("#area").load(url);
    }

    // Event handlers
    $.address.init(function(event) {
        console.log("init: " + $('[rel=address:' + event.value + ']').attr('href'));
    }).change(function(event) {
        $("#area").load($('[rel=address:' + event.value + ']').attr('href'));
        console.log("change");
    })

    $('a').click(function(){
        loadURL($(this).attr('href'));
    });

    });

/*]]>*/

Could you tell me how to figure this out, please?

A973C commented 11 years ago

Can anyone help me please? I've searched over the web and nothing solve this. I'm not a jQuery guru to find a workaround alone...