User Tools

Site Tools


select-option

This is an old revision of the document!


    $.post("/cgi-bin/t.py",
        {
            action: "getvoices"
        })
        .done(function (result, status, xhr) {
            console.dir(result);
            //const obj = JSON.parse(result);
            obj=result;
            console.dir(obj);
            $.each(obj, function (i, item) {
            //    console.dir(i);
                $('#voice').append($('<option>', { 
                    value: item,
                    text : i 
                }));
            });
            //$("#message").html(result)
        })
        .fail(function (xhr, status, error) {
            $("#message").html("Result: " + status + " " + error + " " + xhr.status + " " + xhr.statusText)
        });
select-option.1635173279.txt.gz · Last modified: 2021/10/25 16:47 by admin