Skip to content

Problems adding option to select #35

Description

@tribemax

Select:

<select id="selectcias" class="my-select"> <option>Seleccione...</option> </select>

Create a .js file with the following code:

`
(function ($) {
$.get("/SigaBrokers.xml", function (Broker) {
$(Broker).find("BD").each(function () {

        var ID = $(this).attr('ID');
        var nombre = $(this).attr('nombre');
        var WebSpeed = $(this).attr('WebSpeed');
        var Hosting = $(this).attr('Hosting');
        var imagen = $(this).attr('imagen');
        var activo = $(this).attr('activo');

        var xmlurl = Hosting + WebSpeed + "SigaNet.p?userwin=usuariowin&opc=4"

        $('#selectcias').append('<option data-img-src="/Images/Logos/' + imagen + '" value="' + ID + '">' + nombre + '</option>');
    });
});

})(jQuery);
`

Not adding new options to select, shows me the object without problems. Previously I had the jquery code inside the page and loaded the options but I did not show them, I could see it in the chrome debugger, but clicking on the select did not show me anything. I hope you can help me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions