Javascript 单击按钮JQuery时重新加载外部脚本

Javascript 单击按钮JQuery时重新加载外部脚本,javascript,jquery,Javascript,Jquery,我的博客文章使用ajax加载更多内容,并使用mansory.js显示块 但是当我加载更多的数据时,我的界面因为使用mansory.js而崩溃 如何让ajax加载并重新加载/刷新mansory.js 这里是我的index.html .... <script src="plugins/masonry/masonry.js"></script> <script> $(document).ready(function(){ $(document).on('cli

我的博客文章使用ajax加载更多内容,并使用
mansory.js
显示块

但是当我加载更多的数据时,我的界面因为使用
mansory.js
而崩溃

如何让ajax加载并重新加载/刷新
mansory.js

这里是我的
index.html

....
<script src="plugins/masonry/masonry.js"></script>
<script>
$(document).ready(function(){
   $(document).on('click','#load-more',function(){
       var id = $(this).data('id');
       $("#load-more").html("Loading....");
       $.ajax({
          ....
       });
   });
});
</script>
....
。。。。
$(文档).ready(函数(){
$(文档)。在('单击','加载更多',函数()上){
var id=$(this.data('id');
$(“#加载更多”).html(“加载…”);
$.ajax({
....
});
});
});
....

在请求post重新布局砖石之后,尝试调用以下方法

$grid.masonry()
或者如果使用香草javascript

msnry.layout()
检查