刷新或打开页面后先加载ajax

问题描述 投票:0回答:0

$(文档).ready(函数() {

var screen_width = $(window).width();

如果(屏幕宽度<= 992) {

$.ajax({
  url: '../../pages/sidebar.php',
  success: function(data) {
    $('#sidebar-container').html(data);
    $('#smallbar-container').html("");
  }
});

}否则{

$.ajax({
  url: '../../pages/smallbar.php',
  success: function(data) {
    $('#smallbar-container').html(data);
    $('#sidebar-container').html("");
  }
});

} });

ajax
© www.soinside.com 2019 - 2024. All rights reserved.