Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,727
    Thanks
    80
    Thanked 4,515 Times in 4,479 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •