Question about passing parameters in JQUERY

Source: Internet
Author: User
Hello everyone, I 'd like to ask a question about passing parameters in JQUERY.
Scenario: There are two buttons on a page. the two buttons are the information names in the database respectively. I want to click these two buttons, the corresponding database information can be obtained and displayed in the p layer below. Currently, the value of this button can be sent to jquery as follows:
Corresponding tag information
For (loop) {echo ""; echo""; Echo" $ type_category_name "; echo""; Echo "";}
Red indicates the value corresponding to each label.
Jquery code:
$(function(){    $('.dapei_partmiddle').each(function(){    $(this).click(function(){    $(this).html($(this).attr('name'))        })    })

Now I want to know how to click a tag to call out the name of a tag and put it in the select statement of the database.
The above solutions, online and so on. Thank you.


Reply to discussion (solution)

Help ......

Solve the problem. Can someone help me ??

Ideas:
Click the button to trigger the js event, get the value of the button, and then pass it to the server through ajax. based on the parameters of the transferred button, the corresponding query results are returned (encapsulated into a string, remember to arrange the returned characters in the layout) to the front-end.
Once you switch the button, you can return the query result to the front-end. the specific code implementation depends on your skills.

Ideas:
Click the button to trigger the js event, get the value of the button, and then pass it to the server through ajax. based on the parameters of the transferred button, the corresponding query results are returned (encapsulated into a string, remember to arrange the returned characters in the layout) to the front-end.
Once you switch the button, you can return the query result to the front-end. the specific code implementation depends on your skills. Can you give me an example?

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.