PDA

View Full Version : Element Doesn't add Listener



Belfegor
7 Sep 2007, 7:16 AM
I need to replace the anchor that are load into a panel. I want to replace the link with a call to a contentpanel.load .

I tried



// where el is the anchor
el.addListener('onclick', function(){
painel.load({url:"'"+el.dom.href"'",callback:Example.handleCallback});
return false;
};
el.set({href:"#"});



The href turns to "http://localhost/#"
and the event isn't working

any ideas why ?

Animal
7 Sep 2007, 9:59 AM
"#" indicates the name of an anchor on the current page. It's a link to the current page.

You will be getting syntax errors that you are ignoring.

Read this line:



painel.load({url:"'"+el.dom.href"'",callback:Example.handleCallback});


What do you make of the expression



"'"+el.dom.href"'"


And if your intention is to add apostrophes to your URL..... why?