Advanced Search

Results 1 to 5 of 5

Thread: Ajax Tab Content Script (v 2.2)

  1. #1
    Join Date
    Mar 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax Tab Content Script (v 2.2)

    1) Script Title: Ajax Tab Content Script (v 2.2)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tent/index.htm

    3) Describe problem: everytime i change the tab it always reload even though i were on the tab before, can it be saved?i mean when i first visit the tab off course it will load the content, but the next time i visit the tab again after i go to another tab, it won't reload because it's been loaded before..can it be done?
    thx

  2. #2
    Join Date
    Aug 2004
    Posts
    9,864
    Thanks
    3
    Thanked 960 Times in 949 Posts
    Blog Entries
    15

    Default

    Are you talking about an Ajax fetched content, or IFRAME? With the former, you can disable busting of cache by modifying the code in red in the .js file:

    Code:
    bustcacheparameter=(ajaxfriendlyurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
    to just:

    Code:
    bustcacheparameter=""
    For the later, try modifying the line:

    Code:
    window.frames["_ddajaxtabsiframe-"+contentdivid].location.replace(pageurl) //load desired page into iframe
    to:
    Code:
    window.frames["_ddajaxtabsiframe-"+contentdivid].location=pageurl //load desired page into iframe
    DD Admin

  3. #3
    Join Date
    Mar 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    both of them..
    and btw i've edited the variable bustcacheparameter and window.frames
    but it still doesn't work, it keeps on reloading the requested page of the tab..
    is there anything else i should do?
    thx

  4. #4
    Join Date
    Aug 2004
    Posts
    9,864
    Thanks
    3
    Thanked 960 Times in 949 Posts
    Blog Entries
    15

    Default

    Well, with the changes above, the browser will still load the requested tab's content each time, but it takes advantage of the browser cache so repeat requests should be from the browser cache, not a hard reload of the content. That's different from the script not requesting the content at all after the 1st time- there's no easy way to do this, since the content container area is overwritten each time with the active tab's content.

    Now, Tab Content script loads all the contents all at once and merely toggles between them for any subsequent requests.
    DD Admin

  5. #5
    Join Date
    Mar 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok thx admin...
    Gbu

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
  •