• SK

    (@sooskriszta)


    In a text widget, I have put some JS to load a content piece from another website.

    How can I make this widget (or at least the JS) load asynchronously? Also, I’d like to set a timeout, in case this other site is slow or offline.

    In case you are curious, the JS in the text widget looks something like this:

    <script type="text/javascript" src="http://www.domain.com/javascript/jquery/jquery-1.6.1.min.js"></script>
    <script src="http://www.domain.com/javascript/jquery/jquery.bxSlider.min.js"></script>
    <script src="http://www.domain.com/javascript/jquery/jquery.easing.1.3.js"></script>
    <link rel="stylesheet" href="http://www.domain.com/stylesheet.css"/>
    <script  src="http://www.domain.com/getwidgetscript&widget_type=content_tb&show_description=1&show_type=horizontal&show_once_quantity=1&products_limit=20&categories=37"></script>

Viewing 2 replies - 1 through 2 (of 2 total)
  • There is not way that I know of that this can be doen using WP so to speak. Someone correct me if I am wrong. You could google how to load scripts async and use the methods you find and place them in the footer of your site instead of a widget.

    Thread Starter SK

    (@sooskriszta)

    Thanks, Justin. How do I put the code in footer and have the content appear in the location I desire?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Load script asynchronously’ is closed to new replies.