Link to home
Start Free TrialLog in
Avatar of Seven price
Seven priceFlag for United States of America

asked on

Jquery get value dropdownlist

  $(window).load(function () {
        $(function () {
            $.getJSON('@Url.Action("List", "Search")', function (result) {
                 var ddl = $('#ID');
                 ddl.empty();
                 $(result).each(function (i, item) {

                     ddl.append(
                         $('<option/>', {
                             value: this.ID
                         }).html(this.Description)

                     );
                 });
            });
          

         });

Open in new window

I am using Jquery mobile. When I first go to the page the data loads, When I click a button and leave the page then come back I see the data in my Dom but it does not load back into the dropdown. anyway to fix this.
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Seven price

ASKER

Great thanks