Welcome to WebmasterWorld Guest from 54.161.128.52

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)

Junior Member

5+ Year Member

joined:Jan 29, 2007
posts:123
votes: 0


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.
Welcome!

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.

Clair

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2005
posts: 1526
votes: 0


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 July 20, 2007 (gmt 0)

Junior Member

5+ Year Member

joined:Jan 29, 2007
posts: 123
votes: 0


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.)

Thanks,
Clair

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2005
posts: 1526
votes: 0


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 July 21, 2007 (gmt 0)

Junior Member

5+ Year Member

joined:Jan 29, 2007
posts: 123
votes: 0


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.

Clair

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2005
posts: 1526
votes: 0


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 July 22, 2007 (gmt 0)

Junior Member

5+ Year Member

joined:Jan 29, 2007
posts: 123
votes: 0


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.

Clair