Click Load more at the bottom of the article list, even if sharing the code also ask questions

Source: Internet
Author: User
Click Load more at the bottom of the article list, even if sharing the code also ask questions
JQ Ajax Code:



ThinkPHP3.2.3 Front Controller index method:

Public Function index () {

$p = $_post[' P '];//3 6 9
$amount = 3; Show number of bars
$count = M ("micro_article")->count ();//Total
$Model = new \think\model ();
$list = $Model->query ("select * from ' day_micro_article ' ORDER by Addtime DESC LIMIT $p, $amount");
$this->ajaxreturn ($list);
}
$count = M ("micro_article")->count ();
$Page = new \think\page ($count, 3);

$show = $Page->show ();
$Model = new \think\model ();
The default display of the latest three article
$list = $Model->query ("select * from ' day_micro_article ' WHERE ' status ' = 1 and ' Is_rec ' = 1 ORDER by ' Addtime ' DES C LIMIT ". $Page->firstrow. ',' . $Page->listrows);
$shouyi = M ("Micro_customlucre")->where (Array ("Zid" =>1))->find ();
$this->assign (' list ', $list);
$this->assign (' Vo1 ', $shouyi);
$this->assign (' show ', $show);
$this->display ();
}


My question: Getlocaltime format timestamp function, take out the time 2015/9/4 7:07 in such a format;


I want 2015/9/4 19:07:22 such a format



------to solve the idea----------------------
function Getlocaltime (NS) {
var d = new Date (parseint (NS) * 1000);
return d.getyear () + '/' + (D.getmonth () +1) + '/' + d.getdate () + ' + d.gethours () + ': ' + d.getminutes () + ': ' + d.gets Econds ();
}


Your $.ajax lacks dataType: ' json ' property, so the returned data is a string.
As a share it's immoral (intentionally hiding the key code)

------to solve the idea----------------------
The data you return is TXT, not json. So the explanation is not.



  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.