Results 1 to 3 of 3

Thread: Ajax Tabs Content script - unable to load external .js files for one of the tabs

  1. #1
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax Tabs Content script - unable to load external .js files for one of the tabs

    1) Script Title:
    Ajax Tabs Content script

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...axtabscontent/

    3) Describe problem:
    First I want to congratulate the dynamic drive for providing this excellent script. As I am trying to use it however, I am not able to load external js file for one of the tabs.

    Here is what i am doing:

    a. I created a demo page as per this url
    http://www.globalbizsoft.com/temp/poc/day/demo1.htm
    It works for all tabs except for the last tab ( sea otter) , where in I am trying to load an external javascript file.

    b. I have followed dyanmicdrive guidelines for providing this information for the last tab as per following:
    <li><a href="day.html" rel="ajaxcontentarea" rev="day.js">Sea Otter</a></li>

    c. The file day.html works on its own (independently) and loads the js file as can be seen here:
    http://www.globalbizsoft.com/temp/poc/day/day.html
    But it does not work when called from the tab for sea otter.

    Would appreciate guidance to resolve this..

    Thanks - illibaro

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The problem actually isn't that the feature isn't working, but that you've simply run into a limitation of Ajax. Basically on day.html, the JavaScript you've embedded dynamically writes out content using document.write(). This process can only be performed by the browser inline, when the page is loading. Using Ajax to fetch such a page will result in nothing being written out by document.write(), as this function is now being called dynamically, not inline.

    The easiest way to solve problems is to modify your day.html page so it consist of just an <iframe> that then points to the actual page you wish to load (ie: actualday.html). This should work, or you can try Tab Document Viewer as well.

  3. #3
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you! ddadmin. It looks like that tab document viewer makes sense. I would evaluate it.. illibaro

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •