开发者

Pass array from HTML to Django application

开发者 https://www.devze.com 2023-01-11 07:44 出处:网络
I developed an application in JSPs and Servlets involving drop down menus that kept growing with how m开发者_Python百科any authors per publication their were.

I developed an application in JSPs and Servlets involving drop down menus that kept growing with how m开发者_Python百科any authors per publication their were.

This was done in JavaScript and then in my application iterated through them using a loop. Is this possible using Django? This would be useful in my application.


This link might help you out if you don't want to dive into javascript (too much)

http://www.dajaxproject.com/

Or have a look at this stackoverflow question/awnser:

What is the best AJAX library for Django?

In any case, you need to serialize your array to a JSON string. Then pass the JSON with an XMLHTTPRequest (ajax) to the server.

Add the javascript tag to your question if you don't mind more JS solutions. Otherwise look for a Django Ajax framework to do the heavy lifting for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号