Django ajax no refresh:django view without redirecting or refreshing a page

后端 未结 3 535
攒了一身酷
攒了一身酷 2021-01-17 00:29

I\'d like to execute some Python code if that button is pressed on web.The thing is, I need the page not to redirect or refresh or anything.

3条回答
  •  长情又很酷
    2021-01-17 01:32

    You may want to try the Ajax library for Django project:

    http://www.dajaxproject.com/

    In case you've never heard of Ajax, here's the definition from Wikipedia:

    Ajax (an acronym for asynchronous JavaScript and XML) is a group of interrelated web development techniques used on the client-side to create asynchronous web applications.

    With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page.

提交回复
热议问题