success: function (datas) { //请求成功后处理函数. var htmltext = ''; var data = datas.result; console.log(data) var ihtml = []; for (var i in data) { ihtml.push('<div class="col-md-3 col-sm-6 col-xs-6">' + '<img src="' + data[i].img + '&quo…
<?php class Ajax{ //ajax调用的方法 //sql是要执行的语句 //$type是SQL语句的类型,0代表增删改,1代表查询 //$db代表要操作的数据 public function Ajax($sql,$type=1,$db="lian1") { //造连接对象 $conn = new mysqli($this->host,$this->uid,$this->pwd,$db); //判断连接是否成功 !mysqli_connect_err…