TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,055
  • Total Topics: 21,337
  • Online today: 120
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Javascript Help - Prevent load if URL is not reachable

Started by skip_mff, April 04, 2008, 05:45:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

skip_mff

Hi,

I use this javascript to load windfinder information into my SMF forum 1.1.4 where I run the dilbermc theme. He has an option Current theme settings to load an HTML code to be displayed below the user info bar.

This is the javascript code:

<div style="font-size:1.0em;"><script type="text/javascript" language="JavaScript" src="http://www.windfinder.com/wind-cgi/homepageforecast.pl?STATIONSNR=mt1&UNIT_WIND=kts&UNIT_TEMPERATURE=c&UNIT_WAVE=ft&UNIT_RAIN=mm&NUM_COLS=2&NUM_DAYS=2"></script>

Yesterday for some reason I couldn't access windfinder.com from my connection at home and it prevented the forum from loading. Basically just the top header and forum navigation buttons loaded but not the content.

IE didnt show what was going on but Firefox clearly showed it was stuck loading data from windfinder.com

I would like to know if there is a script command I can add to the above to tell it: 

If the URL is not reachable do not load the script but let the rest of the page load.

Or something similar to achieve the same things.

Thanks,

Skip

G6Cad

Cant really see what this issue have to do with tinyportal ?

Eather ask the theme author to help you, or SMF or even where you got the script from.
If it's not loading it's probably a closed feed or something,
It's not much we can do to help you though  :-\

skip_mff

Just thought someone might be able to help, hence I put it in the chit chat area as opposed to something else. I run a TP front end which is the content that didn't load. It's not entirely specific to TP, SMF or the theme, as it's basically a command to be put in the javascript but as there are some good coders out there thought someone might be able to provide some insight.

JPDeni

I don't know of any way to be able to check to see if a javascript loads. If it was me, I would try to copy the script to my own server so I wasn't dependent on someone else's server for my site. If that didn't work, at the very least I would move the blocks that are dependent on external files to the bottom of the right column so that the rest of the page would load first.

IchBin

What you're talking about is AJAX. They are independant objects on a page. TinyPortal doesn't have any such feature.

skip_mff

Thanks for the replies and good to know about AJAX or trying to run it locally.

This website is proudly hosted on Crocweb Cloud Website Hosting.