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?