Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

News Box created locally and manually operated

click to read each successive item

2:25 pm on Jul 20, 2007 (gmt 0)

5+ Year Member

I think this is not complicated to implement, but I don't know the best direction to go in.

Client wants box on web page that has a news item in it, e.g.,

Mac's Market opening on June 20th.

That's all that would show in the box. But there would be a forward indicator that when clicked, would go on to the next item, and so on.

I don't want six tons of JS sitting on the home page, so am trying to figure out how best to make some code that would walk through the items in an XML file.

This would be like a manually operated RSS reader, but darned if I can find any that are manually operated!

Any ideas appreciated. Thanks much.


4:00 pm on Jul 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

To be honest, I have absolutely no idea what you're talking about. I'm a bit thick, so you need to speak slowly to me.

Could you possibly post a code sample or something?

4:50 pm on Jul 20, 2007 (gmt 0)

5+ Year Member

Marshall --

Imagine an RSS Feedreader in a small box-- one item showing at a time.
The item shows for a short time and then the next one shows up.

I want that, BUT, I don't want it to move automatically. I want there to be a button that goes from the current item to the next, when the user clicks it.

In other words, there's a bit of text in a box, the user clicks a button and the next bit replaces what was there, and so on through a "list" of items.

There are lots of readers out there, but they all operate automatically. (Like the Ajax ticker from dynamicdrive.)


5:39 pm on Jul 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Aw, heck. That's easy. However, the answer isn't really XML. It's JavaScript. You could get your feed as XML and parse it directly, or you can have the server deliver it as JSON, thus removing XML from the equation completely.
12:22 am on Jul 21, 2007 (gmt 0)

5+ Year Member

Marshall --

I have no idea what JSON is?

Could you elucidate -- and would such an operation be doable with an EXTERNAL JS file. I hate tons of JS on the home page?

Thanks again.


2:58 am on Jul 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Well, JSON [json.org] stands for JavaScript Object Notation. It is a text-based data modeling syntax that can be fed to JavaScript from a server, and is handled directly by the language. It's often preferred by people who are doing AJAX [developer.com] work, as it is more directly relevant to JavaScript.

There's a big debate [ajaxian.com] about which is better.

For me, JSON is better for AJAX, but XML is far, far better for sending complex stuff between servers. I will often transfer the data from one server to another in XML (like RSS), then create JSON objects to the local services from the data exchange.

It is just a lot simpler to send stuff either in JSON, or a simple string than to have to deal with XML.

Galleries do what you want to do all the time.

Just have an onclick="" that calls a function that triggers an AJAX call. The callback can replace the text in the innerHTML of the <div>.

9:07 am on Jul 22, 2007 (gmt 0)

5+ Year Member

Thanks Marshall --

I have my work cut out for me -- but you've given me a lot to chew on, and at least some phrases to feed to google!

Thanks again.



Featured Threads

Hot Threads This Week

Hot Threads This Month