Results 1 to 2 of 2

Thread: Ajax Rotating Includes Script

  1. #1
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default Ajax Rotating Includes Script

    Ajax Rotating Includes Script appears to have an omission in its coding. The demo page lays out a means by which multiple rotating includes may appear on one page. However, if the instructions are followed and one of the defined file arrays is:

    var includefiles=

    as more or less suggested, that is the only array that will be used for any and all rotating includes on that page. It may even be so bad as - if that array is not present, there will be no defined files. I don't know about that bit, I haven't tested it. If the ajaxinclude function is added to (addition red):

    Code:
    function ajaxinclude(files_array, rotatetype){
    includefiles=files_array;
    var page_request = false
    if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // if IE
    try { . . .
    This takes care of the problem. See this thread.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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

    Default

    Ah yes thanks for pointing this out (not to mention help out the poor chap). The real problem basically starts at:

    Code:
    function ajaxinclude(files_array, rotatetype){
    "
    "
    var url=choosefile(files_array, rotatetype)
    if (typeof includefiles[url]=="undefined"){
    [/color]
    For the part in red and a few lines following it, I accessed the array
    itself instead of the reference to it: files_array, harding coding things.

    I'll get to fixing this later today or tomorrow. Thanks again,

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
  •