Record data before the next page



  • Code html:

    <li class="widget uib_w_17 clonein" data-uib="jquery_mobile/listitem" data-ver="0">
        <a href="#full_item">
            <span>
                Listitem
            </span>
        </a>
    </li>
    

    Code js:

    $(".groupport").click(function(){
        groupnumber = parseInt($(this).find("span").attr('id'), 10);
    });
    

    Attributes id - Category /цифра/ and class - Category groupportto be downloaded from the server, but as it costs <a href="#full_item"> the js won't download the data.id)

    How do you solve the problem?

    Celements:

    function setgroups(groupnumbers){
    

    $(".leftcorner").empty();
    console.log(groupcount);
    console.log(groupnumbers[1]);
    for (var j = 1;j<groupcount+1;j++){

        var diclone = clonegroup.clone();
        diclone.find("span").text("group"+groupnumbers[j-1]);
        diclone.find("span").attr("id",groupnumbers[j-1]);
        diclone.addClass("groupport");
        $(".leftcorner").append(diclone);
    

    }
    }



  • $(".groupport").click(function(e){
        //отменяете переход
        e.preventDefault();
        //делаете то, что вам нужно
    
        ....
    
        //затем переходите по ссылке
        location.href = 'адресс_ссылки';
    });
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2