SoFunction
Updated on 2025-03-01

Get data through jQuery ajax to realize the method of re-rendering the page after update

1. Introduce jquery and

<script type="text/javascript" src="/libs/jquery/2.1.4/"></script>
<script type="text/javascript" src="/vue/2.2.2/"></script>

2. JS

<script type="text/javascript">
$(function(){
	vm = new Vue({
    el:'#lst',
    data:{
      mcs : []
    }
  });
	getmc();
});
 
function getmc(){
	$.get("",
    function(msg){
	   = msg
  });
}
</script>

3. HTML

&lt;div  v-cloak&gt;
    &lt;div v-for="mc in mcs"&gt;
        &lt;p&gt;
          &lt;a :href="'?id=' +  " rel="external nofollow" &gt;{{}}&lt;/a&gt;
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;&lt;p&gt;
  &lt;input type="button" onclick="getmc()" value="Update Page" /&gt;
&lt;/p&gt;

The above article is the method of re-rendering the page after obtaining data through jQuery ajax. The editor shares all the content with you. I hope you can give you a reference and I hope you can support me more.