Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS calls another site, delays page loading 1

Status
Not open for further replies.

benpollinger

Technical User
Oct 4, 2002
43
GB
Hello all,

I have a web counter called from jellycounter.com, using a line of JS in the <body>:

Code:
<script type=&quot;text/javascript&quot; src=&quot;[URL unfurl="true"]http://www.jellycounter.com/thenew/c/c.html?id=41399&quot;></script>[/URL]

This delays the loading of the page by about 5 seconds, which is annoying.

Is it possible to load the page first, then let the counter load once the main body is displayed?

Regards,
Ben

PS. For reference, the page is:
 
Just move the <script> that you posted to the bottom of the page, right before the </body>.

Rick
 
Thanks Rick, I just tried that but it made no real difference. As before, the page <title> and background colour loads immediately, then there's about 5 seconds before the rest of the page appears, including the counter graphics.

Any other suggestions?

cheers,
Ben
 
Hi mate,

Simple answer but you might not like it.

Remove the counter, or get another one that uses a faster server.

Why don't you use a script on your own server rather than an external one?

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Hello wullie,

Thanks for the suggestions. I had a counter at darkcounter.com but their server crashed and may never return. A shame because it worked very well.

I am using free webspace that doesn't permit scripts - just has a basic mailform.

I have been looking round for other free counters that let me just have numbers (rather than a big graphic advertising the counter site) but not many fitting that bill.

Regards,
Ben
 
Hi, and thanks for the replies.

I first tried playing with defer=&quot;true&quot;, which let the page load but once the external JS completed, I was left with a blank screen.

I've now put the <script> at the very end as suggested, and all is well. It seems it has to be outside the table I was using for formatting.

Thanks again for your help!

Regards,
Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top