Error message on a js newsfeed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danielm60
    New Member
    • Apr 2010
    • 16

    Error message on a js newsfeed

    Hi

    I'm trying to use a free RSS news feed in my webpage and it works like a charm but throws up an error message on the first load:

    myElement.getEl ementsByTagName (naming)[0].firstChild is null

    In firefox error console the message is :

    Error: document.getEle mentById("TICKE R") is null
    Source File: http://www.xxxxxx.com/js/webticker_lib.j s Line: 5

    But in line 5 of the webticker_lib.j s is the statement :

    05 TICKER_CONTENT = document.getEle mentById("TICKE R").innerHTM L;

    It also come up with another error within the page:

    Error: st is undefined
    Source File: http://www.xxxxxx.com/js/ticker.js Line: 103

    But again in the js it is :

    Line: 103

    103 if ( itemLen > st.length ) {
    storyCount++;
    if ( storyCount >= rssItems.length ) {
    storyCount = 0;


    Can someone help please

    Thanks
    Daniel
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    Do you actually have an element with an id attribute of "TICKER"? in your feed?

    You haven't defined st? What is this st you speak of?

    Comment

    • danielm60
      New Member
      • Apr 2010
      • 16

      #3
      Hi
      Yes the id TICKER is used in the html

      And I really don't know what the st is but thats the error message that comes up in the error console I can only presume it refers to the string length of the news story !

      Comment

      • danielm60
        New Member
        • Apr 2010
        • 16

        #4
        Any luck yet?
        Anyone ?

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          I thought you solved it when you said:
          "And I really don't know what the st is but thats the error message that comes up in the error console I can only presume it refers to the string length of the news story ! "

          st is either a typo, or a variable that isn't set properly.

          Comment

          • danielm60
            New Member
            • Apr 2010
            • 16

            #6
            No still showing
            Error: st is undefined
            Source File: http://www.xxxxxx.com/js/ticker.js Line: 103




            103 if ( itemLen > st.length ) {
            storyCount++;
            if ( storyCount >= rssItems.length ) {
            storyCount = 0;

            Comment

            • danielm60
              New Member
              • Apr 2010
              • 16

              #7
              and error

              myElement.getEl ementsByTagName (naming)[0].firstChild is null

              In firefox error console the message is :

              Error: document.getEle mentById("TICKE R") is null
              Source File: http://www.xxxxxx.com/js/webticker_lib.js Line: 5

              Comment

              • jkmyoung
                Recognized Expert Top Contributor
                • Mar 2006
                • 2057

                #8
                EXACTLY! Define st. Yes, YOU, danielm60.

                There's no context as to what itemLen is. For all we know, you might be able to just take it out.

                Comment

                • danielm60
                  New Member
                  • Apr 2010
                  • 16

                  #9
                  Ok but what about the first error ?

                  Comment

                  • jkmyoung
                    Recognized Expert Top Contributor
                    • Mar 2006
                    • 2057

                    #10
                    Post a link to your feed. You're certain you have an element like:
                    <someElement id="TICKER">
                    ?

                    It is case sensitive.

                    Comment

                    • danielm60
                      New Member
                      • Apr 2010
                      • 16

                      #11
                      Hi
                      Yes the element TICKER is def defined in the right case but it was a freebie so ...

                      Anyway thanks for your help and here is the link

                      Comment

                      • jkmyoung
                        Recognized Expert Top Contributor
                        • Mar 2006
                        • 2057

                        #12
                        Do you have control over the html or the js?

                        You haven't added the ticker to the html that the webticker is to be used for.
                        You haven't specified a proper rss feed to be used.

                        Comment

                        • danielm60
                          New Member
                          • Apr 2010
                          • 16

                          #13
                          Hi

                          err yes I have ... as I said it already works so if it didn't .. it wouldn't work.

                          It calls it from the webticker_lib.j s which in turn uses grab.php to retrieve the feed.
                          Sorry I must be in the wrong site. I thought if I gave you an error code you could simply point me in the right direction of a fix.

                          Don't worry I'll go and find another site.

                          Comment

                          • jkmyoung
                            Recognized Expert Top Contributor
                            • Mar 2006
                            • 2057

                            #14
                            Putting in the js doesn't put in the xml elements into your html.

                            You've put in one part, the overlying functions, but completely neglected to put in the structures with which it works with. I don't know how to make this any more clear.

                            Your html is missing essential parts for the js to work. It's like telling a function:
                            "Go increment the web counter", but then never putting a web counter on your page.
                            The function then goes, "uhhh... what web counter?"

                            In your case, you're saying "Go read the RSS feed!" and the function is telling you, "But boss, there is NO RSS feed!"

                            Good luck with your code.

                            Comment

                            Working...