About the problem of jquery passing parameters

Source: Internet
Author: User
On the problem of jquery passing parameters
Hello, little brother, I want to ask a question.
Scene: A page has 2 buttons, two button names are the information name of the database, I hope that by clicking on the two buttons, you can get the corresponding database information in the DIV layer below, it is now possible to give the value of the button to jquery, the operation is as follows:
The corresponding label information
       for (loop) {     echo "";
echo "";
echo "$type _category_name";
echo "";
echo "";}
The red label is the value that corresponds to the entire label.
jquery Code:
$ (function () {
$ ('. Dapei_partmiddle '). each (function () {
$ (this). Click (function () {
$ (this). HTML ($ (this). attr (' name '))
})
})

Now I want to know how I can click on a tag to call the name of a tag and put it in the database SELECT statement
Above solve,, online and so on. Thank you

Share to:


------Solution--------------------
Ideas:
By clicking the button to trigger the JS event, get the value of the button, and then pass Ajax to the server, according to the parameters of the Transfer button, return the corresponding query results (encapsulated into a string, remember to put the returned character layout) to the front end.
Switch One button, return the query to the results of the string returned to the front, the specific code to achieve, depends on your skills.
  • 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.