javascript - how to read html data from another page using ajax -


this url "users/1/providers/1/check" page containing following html

<select id="document1" class="form-control">         <option th:value="0" >select document want share</option>         <option th:each="document : ${documents}" th:value="${document.id}" th:text="${document.name}">[name]</option> </select> 

on url "/users/1/providers/1/documents/1/consents/new: want access data in html "users/1/providers/1/check"

<select id="provider" name="provider" class="form-control" th:onchange="'javascript:showpiidoc(this.value);'">                                                     <option th:value="0" >select service provider</option>                                                     <option th:each="provider : ${user.providers}"  name="name"  th:value="${user.id} +','+ ${provider.id}" th:text="${provider.name}" >[name]</option>                                                 </select> 

using ajax how it. using spring mvc

function showpiidoc(doc) {     var split = doc.split(",");     var userid = split[0];     var providerid = split[1];     $.ajax({          url: '/users/'+ userid +'/providers/' + providerid + '/check',         success: function(html){             //create jquery object response html.             var $response=$(data);              //query jquery object values             var oneval = $response.filter('#document1').text();             alert(oneval);         }     });     });  } 

please guide me


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -