jQuery Design Question

[Unsolved] Question for you, problem for me. :3

Page 1 of 1

4 Replies - 632 Views - Last Post: 16 June 2010 - 09:45 AM

#1 Bladescope  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 71
  • Joined: 01-September 09

jQuery Design Question

Posted 16 June 2010 - 08:24 AM

Hey D-I-Coders,

I've made a live feed which grabs content off multiple sources, inserts into my database and then spits out the latest 20 articles.

The feed updates every minute, which is where I've run into a design flaw.

Everything worked fine and dandy until I wanted to add day headers.

Adding the headers was fine, it was processed in PHP and added before they were retrieved via jQuery's AJAX.

The problem is, the header script (php) is always run when retrieving data from the database, meaning this:

Page Opens, feed is displayed:

TODAY

     blah

     blah2

     blah3

YESTERDAY

    blah4

    blah5



When the feed checks for updates (and if there is at least one), it comes out like this:

TODAY

   blah0

TODAY

   blah

   blah1

...



I've been jotting down a few ideas to go about solving this on the jQuery side, possiby when retriving the data, check to see if the day exists in the feed and prepend the updated items to after that day (<div>) header

or, I could search for and remove the current header in the feed and just prepend the data at the top.

Though, another issue is that I want the feed day headers to update on a new day too, so if one said TODAY at 23:59, it would change to YESTERDAY at 00:00.

That could be solved with some AJAX and a hidden timestamp though, possibly.

Though without rushing ahead of myself, I'm still confronted with the first problem and no definate solution yet, so I'm asking for help here, if possible.

Script/snippets are available on request if needed, just ask.

Any help you can give on this matter is appreciated,

Bladescope

This post has been edited by Bladescope: 16 June 2010 - 08:25 AM


Is This A Good Question/Topic? 0
  • +

Replies To: jQuery Design Question

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: jQuery Design Question

Posted 16 June 2010 - 08:30 AM

Yeah you're going to need to show the experts in this field how you're accomplishing this. Without being able to see what & how you're doing it it's nearly impossible to help you formulate a solution :)
Was This Post Helpful? 0
  • +
  • -

#3 Bladescope  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 71
  • Joined: 01-September 09

Re: jQuery Design Question

Posted 16 June 2010 - 09:39 AM

This is blatantly going to be a lot, possibly even too much.

I've snipped out a lot of the unneeded coding.

You can see a screenshot of it in action (with the problem described) too in the attatchments.

Thanks for spending time to help me with this (you can still turn around and run for the hills when you want!)

Attached image(s)

  • Attached Image

Attached File(s)


This post has been edited by Bladescope: 16 June 2010 - 09:40 AM

Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: jQuery Design Question

Posted 16 June 2010 - 09:42 AM

I haven't looked at the code (I just have this thing about downloading unknown files from unknown people - no offense meant) but are you clearing your list before repopulating it with the new updates?
Was This Post Helpful? 0
  • +
  • -

#5 Bladescope  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 71
  • Joined: 01-September 09

Re: jQuery Design Question

Posted 16 June 2010 - 09:45 AM

View PostPsychoCoder, on 16 June 2010 - 08:42 AM, said:

I haven't looked at the code (I just have this thing about downloading unknown files from unknown people - no offense meant) but are you clearing your list before repopulating it with the new updates?


(none taken ;))

Nope, I'm using .prepend(foobar)

meaning it's getting added to the top, well the new entries are anyway.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1