Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6627875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:03:54+00:00 2026-05-25T22:03:54+00:00

var intervalID; function autoUpdateFeed() { if( document.autoupdatefeedform.autoupdatefeed.checked == true ) { intervalID = setInterval(updateFeed,

  • 0
var intervalID;
function autoUpdateFeed() 
{
    if( document.autoupdatefeedform.autoupdatefeed.checked == true )
    {
        intervalID = setInterval(updateFeed, 1000);
    } else {
        clearInterval(intervalID);
    }
}
function updateFeed()
{
    var oRequest;
    try {
            oRequest=new XMLHttpRequest();
        } catch (e)   {
        try {
            oRequest=new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
            try {
                oRequest=new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {
                    alert("Your browser does not support AJAX!");
                    return false;
                }
             }
        }
        oRequest.onreadystatechange=function()
    {
        if(oRequest.readyState==4)
        {
        //Start of problem.
            var newfeedstable = document.getElementById("newfeeditems");
            var newcontent = document.createElement('tr');
            newcontent.innerHTML = oRequest.responseText;
            while (newcontent.firstChild)
        {
                newfeedstable.insertBefore(newcontent.firstChild, newfeedstable.firstChild);
            }
        //End of problem.
        }
    }
    oRequest.open("GET","back/newsfeedlatest.php",true);
    oRequest.send(null);
}

Here is the JavaScript code I and my friend are currently using to add new status updates to a table for new status updates on our work-in-process social networking site, the problem is when the new elements are added to the table, they tile to the side, instead of tiling downwards, so I need to know why this is happening and how to fix it, any ideas? For more information, look at the website, you may have to make an account but feel free to use a fake email until we start using email activation again. http://friendgrid.com/
Here’s a screenshot of the problem for further reference: http://dl.dropbox.com/u/2281426/Newsfeed%20Error.bmp

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:03:55+00:00Added an answer on May 25, 2026 at 10:03 pm

    The issue would be at the line inside the While:

    newfeedstable.insertBefore(newcontent.firstChild, newfeedstable.firstChild);
    

    There the first parameter should be only newcontent without the .firstChild, the firstChild would be inserting only that element and not the newly created <TR>

    Altough i suggest you to use DOM methods to modify tables, something easier like:

    TableElement.insertRow( 0).innerHTML = oRequest.responseText;
    

    TableElement in your case would be newfeedstable, which if you don’t need it later you could reduce to:

    document.getElementById("newfeeditems").insertRow( 0).innerHTML = oRequest.responseText;
    

    The 0 as parameter would make the insert always as first row, use a -1 to insert always as last row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var thumbs = document.getElementsByTagName(img); for (var i=0; i<thumbs.length; i++) { Core.addEventListener(thumbs[i], click, function() {alert(i);});
var arr = [[1,2,3],[4,5,6],[7,8,9]]; function out(ar){ var interval = setInterval(function(){ for (var i=0; i<ar.length;i++){
var y = new w(); var x = y.z; y.z= function() { doOneThing(); x();
I need to access this from my setInterval handler prefs: null, startup : function()
I thought I would try and be clever and create a Wait function of
Here is the code: //Mouseover start countdown $(#icon_no_1).mouseover(function() { $(this).fadeTo(slow, 0.23); //Countdown var counter
I am having difficulties testing window.setInterval function in my Javascript file. Below is the
Within my a certain function of a class, I need to use setInterval to
How can I pass variables by reference to setInterval's call back function? I don't
I have some javascript code (within an object) : toggle: function() { var me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.