javaWeb开发细节总结(3)

来源:互联网 发布:淘宝卖百货用什么类目 编辑:程序博客网 时间:2024/06/06 02:27

1.如何设置jquery的ajax方法为同步

Ajax请求默认的都是异步的

如果想同步 async设置为false就可以(默认是true)

var html = $.ajax({
  url: "some.php",
  async: false
}).responseText; 

或者在全局设置Ajax属性
$.ajaxSetup({
  async: false
  });

再用post,get就是同步的了


2.bootstrap中按钮的显示位置

在class属性中设置:pull-left 左侧 ,pull-right右侧,pull-center 居中

0 0
原创粉丝点击