Hello, everyone, I want to ask a question scenario: There are two buttons on a page, and the two buttons are the information names in the database respectively, I want to click these two buttons to obtain the corresponding database information, which is displayed in the div layer below. Currently, the value of this button can be assigned to jquery. The operation is as follows: corresponding tag information & nbsp; & n about JQUERY parameter passing
Hello, everyone. I want to ask a question.
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 div layer below. Currently, the button value can be sent to jquery as follows:
Corresponding tag information
For (loop) {echo "";
Echo"
";
Echo "$ type_category_id '> $ 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 for sharing:
------ Solution --------------------
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.