Need help with javascript. Fairly basic stuff I believe.

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
User avatar
Martin
Regular
Posts: 90
Joined: Mon Sep 27, 2004 1:30 am
Location: Oslo
Contact:

Need help with javascript. Fairly basic stuff I believe.

Post by Martin » Fri Aug 17, 2007 2:55 pm

Ok. I'm gonna try and make sense here.

I've just hacked my template to include digg/reddit buttons on each entry.
Check http://www.hastalasiesta.org to see what I'm on about.

My one concern is that the Javascript in the buttons make the page pause for a moment while loading. The solution I have in mind is to delay the loading of the buttons until the rest of the page has loaded.

Now; I know there's a body.onload solution that is in the neighbourhood of what I'd like to achieve, but as far as I know this command needs to write to a specific ID on the page. Since there are multiple div's with buttons I can hardly use ID's rather than Classes.

If anyone could help me out with this (preferably with a comprehensible code example as I'm not too hot on JavaScript.) I'd be very grateful.

-m[/url]

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Need help with javascript. Fairly basic stuff I believe.

Post by garvinhicking » Fri Aug 17, 2007 3:36 pm

Hi!

Hm, you might need to ask this in a javascript-forum, there might be more people who can help you with that.

I beliefe in IE the '<script ... defer>' does what you want.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
Martin
Regular
Posts: 90
Joined: Mon Sep 27, 2004 1:30 am
Location: Oslo
Contact:

Post by Martin » Fri Aug 17, 2007 5:04 pm

@garv: I just assume that the codemonkeys of the world are to be found here. ;)

Post Reply