Setting timeout on external javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • -@-

    Setting timeout on external javascript

    Hi there All,

    Don't know if this is possible at all, but here goes.

    I've got a page (an active server page if that makes any difference), that
    is pulling some sticky content from www.freesticky.com using the following
    code:

    <script type="text/JavaScript"
    src="http://www.freesticky. com/stickyweb/syndicate/otd_events_hlin es.asp"></
    script>

    The problem is that occasionally www.freesticky.com is unavailable, and so
    is the stuff I'm trying to display. This in turn causes my page to hang.

    Is it possible to set some kind of timeout, or something that will allow my
    page to complete loading even if this stuff is not available.

    Any help you could offer would be major cool.


    Thanks,

    @ndyB



  • Grant Wagner

    #2
    Re: Setting timeout on external javascript

    "-@-" wrote:
    [color=blue]
    > Hi there All,
    >
    > Don't know if this is possible at all, but here goes.
    >
    > I've got a page (an active server page if that makes any difference), that
    > is pulling some sticky content from www.freesticky.com using the following
    > code:
    >
    > <script type="text/JavaScript"
    > src="http://www.freesticky. com/stickyweb/syndicate/otd_events_hlin es.asp"></
    > script>
    >
    > The problem is that occasionally www.freesticky.com is unavailable, and so
    > is the stuff I'm trying to display. This in turn causes my page to hang.
    >
    > Is it possible to set some kind of timeout, or something that will allow my
    > page to complete loading even if this stuff is not available.
    >
    > Any help you could offer would be major cool.
    >
    > Thanks,
    >
    > @ndyB[/color]

    You can try setting DEFER on the <SCRIPT> tag:

    <url:
    Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

    />

    However, be aware that even if it works in a browser [1], it may produce other
    errors if code in your own page relies on code that is defined in the file you
    are sourcing for the script tag. I believe there's more to the use of DEFER, I
    seem to recall some discussion about it here in the recent past, you might find
    more information at <url:

    />.

    Also, there's no guarantee it will prevent the browser from stalling if the host
    from which the SRC is being loaded is unavailable, although it probably should.


    [1] note what it says at <url:
    http://www.w3.org/TR/REC-html40/interact/scripts.html />
    defer [CI]: When set, this boolean attribute provides a hint to the user agent
    that the script is not going to generate any document content (e.g., no
    "document.write " in javascript) and thus, the user agent can continue parsing
    and rendering.

    The operative words in that explanation are "hint to the user agent".


    --
    | Grant Wagner <gwagner@agrico reunited.com>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *


    * Internet Explorer DOM Reference available at:
    *
    Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 7 / Mozilla
    * http://www.mozilla.org/docs/web-deve...upgrade_2.html


    Comment

    • Kien

      #3
      Re: Setting timeout on external javascript

      Hi,
      I would stick that script link onto another file then use iframe or something
      to show it on your site.
      Kien

      "-@-" <abc@abc.com> wrote in message news:<40be09d8$ 0$6325$65c69314 @mercury.nildra m.net>...[color=blue]
      > Hi there All,
      >
      > Don't know if this is possible at all, but here goes.
      >
      > I've got a page (an active server page if that makes any difference), that
      > is pulling some sticky content from www.freesticky.com using the following
      > code:
      >
      > <script type="text/JavaScript"
      > src="http://www.freesticky. com/stickyweb/syndicate/otd_events_hlin es.asp"></
      > script>
      >
      > The problem is that occasionally www.freesticky.com is unavailable, and so
      > is the stuff I'm trying to display. This in turn causes my page to hang.
      >
      > Is it possible to set some kind of timeout, or something that will allow my
      > page to complete loading even if this stuff is not available.
      >
      > Any help you could offer would be major cool.
      >
      >
      > Thanks,
      >
      > @ndyB[/color]

      Comment

      Working...