简体   繁体   中英

Save DnD state with django / javascript

I am doing a javascript program to drag and drop users in groups. I want save the configuration of users and groups in the db. If I can make a post request, I will do this save easly in a view.

So, I have thought to create a post request in javascript, is it possible, safe ?

Is there any better possibility with django ?

Are you using jQuery? If so check this out: http://api.jquery.com/jQuery.post/

you can call something like this:

$.post('script_to_run.php?infotosave=3');

And then you create the 'script_to_run.php' file to query your database and store any information that you need to.

You can do it with just javascript (no jQuery) but it is much simpler with jQuery

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM