Seeking ideas: The solution of juqery+thinkphp's question and answer system
Source: Internet
Author: User
Seeking ideas: Juqery+thinkphp's question and answer system
The general requirement is to click on the left-hand side of the question, and all answers to the question appear on the right. Question I have called from the database.
My thoughts.
1. The answer to the question is always queried from the database, then written down and then displayed through jquery (or written)
2. Or through jjquery to obtain the ID of the problem, fax to thinkphp, query the database, output? ()
3. Do you want to use Ajax?
Should choose which, probably how to realize
Because I only saw the jquery tutorial, all a little do not know where to start, novice, described a little unclear.
------to solve the idea----------------------
The 2nd you're talking about is going to use Ajax.
As for 1 or 2 good, depending on the number of questions
Only dozens of to simply find out the answer, by JS Click to change the right div content
If a lot of problems, but also with the page, Ajax search
Jquery:
$.get (url?id=123, function (data) {alert (data)})
thinkphp:
$this->ajaxreturn ($data);
------to solve the idea----------------------
Front desk JQ Modify CSS
The number of one-page queries in the background + paged Ajax query
------to solve the idea----------------------
$ (document). Ready to bind events only to the button at the beginning of the page
You add a class:js_up to the likes button and add a id= "123".
Then jquery wrote: $ ('. Js_up '). Live (' click ', Function () {Ajax submit-like, ID is the button's ID property})
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