PHP + Mysql + jQuery implement microblog program jQuery _ php skills

Source: Internet
Author: User
We can see a topic posting application on websites such as QQ personal center or Sina Weibo. this application enables real-time statistics on the number of input words and interacts with the background through ajax, insert the input content to the topic list. I divided the entire process into two parts. This article explains the first part of jquery's frontend interactive operations.

First view the example: DEMO


XHTML

The code is as follows:








DemoReleased content...








XHTML is a form with the input box textarea, the publish button, a span # counter that counts the number of input words, and a message indicating span # msg, if no input is provided, the system prompts you to enter the content.
CSS

The code is as follows:


H3 {height: 32px; line-height: 32px; font-size: 18px}
H3 span {float: right; font-size: 32px; font-family: Georgia, serif; color: # ccc; overflow: hidden}
. Input {width: 594px; height: 58px; margin: 5px 0 10px 0; padding: 4px 2px;
Border: 1px solid # aaa; font-size: 12px; line-height: 18px; overflow: hidden}
. Sub_btn {float: right; width: 94px; height: 28px ;}
# Msg {color: # f30}
. Clear {clear: both}
. Saylist {margin: 8px auto; padding: 4px 0; border-bottom: 1px dotted # d3d3d3}
. Saylist img {float: left; width: 50px; margin: 4px}
. Saytxt {float: right; width: 530px; overflow: hidden}
. Saytxt p {line-height: 18px}
. Saytxt p strong {margin-right: 6px}
. Date {color: #999}


JQuery
First introduce the jquery library and the global. js file:

The code is as follows:


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.