Hi, thanks for the response. I have corrected the link.
The code that I posted is actually part of the "Behaviour" js library. All that it does it replace the onclick attribute for the specified anchors, so I don't have to have obtrusive javascript right in my xhtml.
However, I think the problem isn't with the "behaviour" part, since the first onclick (ajaxpage) works as intended. It's the second (the loadobjs function) part where I suspect I'm messing up.
Here's the rest of the code I posted above:
Code:
var myrules = {
'a.links' : function(el){
el.onclick = function () {ajaxpage(this.href, 'content'); loadobjs('common.js','flashobject.js','domcollapse.js'); return false;}
}
};
You can see that it gives all "a class="links"" items the onclick.
Thanks again!
edit - I should also mention that I tried this without the added "behaviour" actions, and I just added them right to the link like this:
HTML Code:
<a href="javascript:ajaxpage('/shows', 'content'); loadobjs('/js/common.js','/js/flashobject.js','/js/domcollapse.js');" title="Shows" class="links">Shows</a>
With no such luck - still loads the page into the right spot, but doesn't apply the other scripts. It's like that right now at www.superbuick.com if you want to see the code in its native habitat.
Bookmarks