Moving threads...

about 1 year ago - David Crean

For a personal project of mine I'm attempting to do a live update thing. It should be fairly simple, I go and retrieve the most recently updated threads in order that they were updated and inject them to the top of the list... removing the duplicate from the list of threads. Basically, it's a quick way for people to see threads as they come in. It will be handle on those rare occasions that people are all posting at once. I can have it run every 20-30 secs and update the list for people.

For some reason, my splice code is not working. It's not really the friendliest of codes, but it should be working... it's quiet perplexing.

for(i = 0; i < topicLim; i++) {

topic_id = getTag(topics[i],"id");

topic_list[i] = topic_id

for(j = 0; j < cur_topic_list.length; j++) {

if(cur_topic_list[j] == topic_id) {

cur_topic_list = cur_topic_list.splice(j,1);

topic_table.deleteRow(j+row_count);

}

}

ThreadManager.addTopic(topics[i],row_count);

row_count++;

if(document.title.match(/^\(\*\)/) != '(*)') {

document.title = '(*) '+ document.title;

}

}

Tags: web design javascript programming ooboos

0 Comments on Moving threads...

Leave a Comment

About Me

I'm a UI developer living in Los Angeles with my wife and 5 hell-raising cats.

I will randomly be spouting my random thoughts and highlighting work that I'm proud of, or sometimes, not so proud of.

One aside about this site, I don't go out of my way to hack around IE6 here, I spend enough time doing that day in and day out. It should work reasonably well in modern browers, but I don't go out of my way to hack around fawlty border implementation or lax support for child selectors.