jquery dynamic select append options expecting alert("text") -
jquery dynamic select append options expecting alert("text") -
i have pulled info backend using ajax/json, , trying append info select box using jquery. info appended select box properly, showing on page when set alert("some text")
.
here code:
jquery.ajax({ url: "the_url.php" success: function(data) { var comp_select = jquery("select[class='xf-depselect-selector depselect-fragment']").get(3); alert("ready now"); (var = 0; < data.length; i++) { jquery(comp_select).append(jquery('<option>', { value: data[i]["component_name"] }).text(data[i]["component_name"])); } }, complete: function() {}, async: false, datatype: 'json' });
jquery select dynamic append xataface
Comments
Post a Comment