If I were you I wouldn't let JavaScript do the randomizing, I would do it
server-side instead, providing a request that returns a random record and
pinging it with a simple AJAX query ; this way, JavaScript doesn't need to
be aware of what you want to send and it doesn't select the id client-side
(without the database nearby).

Michel Belleville


2009/12/1 Charlie <charlie...@gmail.com>

>  link to different random functions depending on db
> http://www.petefreitag.com/item/466.cfm
>
> $getJSON and volia!
>
>
> Dave Maharaj :: WidePixels.com wrote:
>
> Has anyone come across a simple function that will get a random record from
> the db?
>
> I just need to send a request every min or so to get new content from the
> db and change the content. Pretty much like a banner rotator but used for
> random content.
>
> thanks,
>
> Dave
>
>
>

Reply via email to