Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-03 16:44:34

mwillse
Member
From: brooklyn, ny
Registered: 2006-06-26
Posts: 83
Website

sidebar article with slow javascript

hey smart folks, I’m wondering if you have any suggestions for me.

I have a sidebar poll widget that is slowing down the loading of my site. It calls a thirdparty javascript. Ordinarily, I would put the <script src="..." ></script> at the bottom of my page before </body>. This would be easy if I displayed the poll as a single article. But as a homepage sidebar element, I’m not sure if that’s possible.

I don’t want to hardcode the script to be called in <body onload="" > because this poll isn’t a permanent thing.

Is there a way my page template can sniff out and grab the custom field of an article generated from article_custom list and put it somewhere else on the page?

Or, is there way <script src="" ></script> can be asked to wait for the body to be done loading?

thanks for any and all suggestions…

Offline

#2 2007-08-03 18:00:20

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: sidebar article with slow javascript

Might be a use case for WEDJE.

Offline

#3 2007-08-04 10:26:01

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: sidebar article with slow javascript

Make use of the defer attribute.

Offline

Board footer

Powered by FluxBB