Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  permalink
    Hi,

    I am relatively new to jQuery and Javascript and a client has asked for a drop down menu which allows the user to sort some parsed XML by a) Name going from A-Z b) Prize Fund from high - low

    Does anyone know if this is possible?

    This is the code below that I have at the moment:

    $(document).ready(function(){
    $.ajax({
    type: "GET",
    url: "bingo.xml",
    dataType: "xml,"
    success: function(xml) {
    $(xml).find('bingoSchedule').each(function(i){
    var title = $(this).find('ticketName').text();
    var url = $(this).find('linkToPlayForCash').text();
    var drawtime = $(this).find('drawTime').text();
    var servertime = $(xml).find('serverTimeStamp').text();
    var time = drawtime - servertime;
    var room = $(this).find('gameType').text();
    var fund = $(this).find('prizeFund').text();
    var price = $(this).find('price').text();

    if(i%2) {
    var oddEven = "odd"
    }
    else {
    var oddEven = "even"
    }

    var jhtml = '<div id="cj_begun' + +i +'" class="cj_begun"> </div>';
    jhtml += '<div class="cj_bomb">';
    jhtml += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="55" height="65">';
    jhtml += '<param name="movie" value="../style2009/flash/bombCounter.swf?countDown=' + time + '&controlId=cj_begun' + i +'" />';
    jhtml += '<param name="quality" value="high" />';
    jhtml += '<param name="wmode" value="transparent" />';
    jhtml += '<embed src="../style2009/flash/bombCounter.swf?countDown=' + time + '&controlId=cj_begun' + i +'" quality="high" wmode="transparent"pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="55" height="65"></embed>';
    jhtml += '</object>';
    jhtml += '</div>';
    jhtml += '<div class="cj_gamedetails"><p>';
    jhtml += '<strong>' + title + '</strong><br />';
    jhtml += 'Room: ' + room + '<br />';
    jhtml += 'Prize Fund: £' + fund + '<br />';
    jhtml += 'Price: £0.' + price + '</p>';
    jhtml += '</div>';
    jhtml += '<div class="cj_play">';
    jhtml += '<a href="' + url + '?phpMyAdmin=4594f30712f4fabaff6997416810f3f2"><img src="../style2009/img/button_playnow2.gif" title="Play Now" alt="Play Now" /></a>';
    jhtml += '</div>';

    $('<div class="cj_row ' + oddEven + '"></div>').html(jhtml).appendTo('#cj_bingo');

    });
    }
    });
    });