Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-07-2010, 07:11 PM   PM User | #1
nuwud
New to the CF scene

 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
nuwud is an unknown quantity at this point
Question Display Alphabetically only one letter at a time

Hi,

I want to display my listings like they do here: http://www.ticketnetwork.com/performers/concerts/a.aspx

The code on my end calling the third party service looks like this:

<script language="javascript" type="text/javascript">
document.write('<script language="javascript" src="http://###########.com/?bid='+####+'&sitenumber='+#+'&tid=event_names&pcatid=2&showcats=true&title=Concerts Tickets"></' + 'script>');
</script>

How do I make it only display one letter at a time? I believe some variation on the sort method might work...
nuwud is offline   Reply With Quote
Old 09-07-2010, 07:49 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
They are doing it by actually having separate pages for each letter.

Didn't you notice that the page changes from "a.aspx" to "b.aspx" (etc.) as you change letters?

They are doing it 100% server side, no JavaScript funnies involved.

*IF* your list of *ALL* events/letters isn't too long, then doing it in JS code is pretty trivial. You'd just put each letter into a separate "panel" and then activate one panel at a time.

Instead of using document.write, it would probably make more sense to use XMLHTTP in synchronous mode (that is, SJAX as opposed to AJAX) to get the contents, put them in your JS array, sort the array, and *THEN* create the panels.

If you showed us an example of what that "feed" sends to you, it would be easier to help.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Tags
alphabet, javascript, sort

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:35 AM.


Advertisement
Log in to turn off these ads.