Results 1 to 4 of 4

Thread: Advanced RSS Ticker (Ajax invocation)

  1. #1
    Join Date
    Jan 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Advanced RSS Ticker (Ajax invocation)

    Good evening,

    I have a question about the great script "Advanced RSS Ticker (Ajax invocation)".

    Sometimes, the request fetch to the RSS news fails (server down, delayed answer, etc).

    I was able to handle the error message without a problem (I've made a simple "Please wait"...)

    My question is: how do I repeat the request after 60 seconds - for instance - until the request is sucessfull?

    I've tryed some javascript functions like set interval, etc. But I'm not geting any results... The repeating results appears in a new fresh blank window.

    Any ideas?

    Cheers,

    JKepler

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

    Default

    Warning: Please include a link to the DD script in question in your post, in this case, . See this thread for the proper posting format when asking a question.

    Try modifying the below code of code inside the .js file:
    Code:
    rssticker_ajax.prototype.initialize=function(){ 
    if (this.ajaxobj.readyState == 4){ //if request of file completed
    if (this.ajaxobj.status==200){ //if request was successful
    var xmldata=this.ajaxobj.responseXML
    if(xmldata.getElementsByTagName("item").length==0){ //if no <item> elements found in returned content
    document.getElementById(this.tickerid).innerHTML="<b>Error</b> fetching remote RSS feed!<br />"+this.ajaxobj.responseText
    return
    }
    with the additions in red:


    Code:
    rssticker_ajax.prototype.initialize=function(){ 
    if (this.ajaxobj.readyState == 4){ //if request of file completed
    if (this.ajaxobj.status==200){ //if request was successful
    var xmldata=this.ajaxobj.responseXML
    if(xmldata.getElementsByTagName("item").length==0){ //if no <item> elements found in returned content
    document.getElementById(this.tickerid).innerHTML="<b>Error</b> fetching remote RSS feed!<br />"+this.ajaxobj.responseText
    var thisinst = this
    setTimeout(function(){
    thisinst.initialize()
    }, 60000)
    return
    }
    I haven't tested the above changes myself, but it should work. While testing, you may want to change 60000 (60 seconds delay) to a smaller number, like 6000 (6 seconds).
    DD Admin

  3. #3
    Join Date
    Jan 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    I've made some tests...It seems it doesn't work if we call multiple rss feeders. I've changed one url in the bridge.php (for the wrong one) and then in the process uploaded the right one. The feed doesn't update...

    Cheers,

    JKepler

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

    Default

    Hmm how are you switching from the wrong URL to the correct one "mid flight"? With the changes I proposed above, it only works whereby a single URL that couldn't be fetched or is broken suddenly works after another attempt at fetching it.
    DD Admin

Similar Threads

  1. Advanced RSS Ticker (Ajax invocation)
    By bobster in forum Dynamic Drive scripts help
    Replies: 12
    Last Post: 06-24-2012, 12:43 AM
  2. Replies: 2
    Last Post: 06-08-2009, 05:50 PM
  3. Advanced RSS Ticker (Ajax invocation)
    By csseur in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 01-25-2008, 05:44 AM
  4. Advanced RSS Ticker (Ajax invocation)
    By balous in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 06-15-2007, 09:16 PM
  5. Advanced RSS Ticker (Ajax invocation)
    By Beezie in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 09-28-2006, 06:28 AM

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
  •