Home > front end >  Django how to response the checkbox or radio when the choice of events, local refresh the page.
Django how to response the checkbox or radio when the choice of events, local refresh the page.

Time:10-01

The Django framework can response events for the button click,
Such as under the static template file


The test


The test

<body>



The above two controls in the Django can through response POST corresponding to the function to make the action & lt;/p>


How to respond to the above two button when the selected function & lt;/p>




Of course I saw some example is Return a page render function rendering, always to reload the page, if the implementation is only part of the refresh the page?

Dared ask each great god, and how to implement, thank you

CodePudding user response:

Ok, I know that my problem by looking for information, Django encapsulation Ajax, in order to realize local refresh this functionality, still have to use JS, sent an Open request, a url Django response in the background, python just doing the background, the front desk, still have to use JS implementation,
I read the relevant document:
https://www.w3school.com.cn/ajax/ajax_xmlhttprequest_send.asp
https://www.cnblogs.com/stwzhong/p/3650543.html
  • Related