JQuery/Javascript how to Parse HTML using a Get

后端 未结 2 782
南旧
南旧 2021-01-28 08:07

I have the following working code. This displays a drop down and also fetches a html file to be displayed:

   $.getJSON(\'json/shares.json\', function(data) {
          


        
2条回答
  •  臣服心动
    2021-01-28 08:35

    Well for the first point you could just run

    $('#shares').on('change', function(){
        var val = $(this).val();
        //submit another ajax request with this value, and get the relevant page, then you'd just need to parse it for the appropriate content from that page.
    });
    

    If you want to parse the returned page and get only part of this we'd need to know the markup structure.

提交回复
热议问题