使用simplejson转储创建选择列表

时间:2022-10-07 16:03:08

Based on "Using AJAX to Enable Client RPC Requests 1 " article I've created a list.

基于“使用AJAX启用客户端RPC请求1”文章,我创建了一个列表。

By using: self.response.out.write(simplejson.dumps(result_list)) I can read the result_list using <input id="result_list" type="text" value="" />

通过使用:self.response.out.write(simplejson.dumps(result_list))我可以使用读取result_list

Help requested: How to convert the "result_list" into HTML Select List?

请求帮助:如何将“result_list”转换为HTML选择列表?

2 个解决方案

#1


0  

loop over the values in the list and create a select tag.
http://www.w3schools.com/tags/tag_select.asp

循环遍历列表中的值并创建一个选择标记。 http://www.w3schools.com/tags/tag_select.asp

#2


0  

The doc showing "Using AJAX to Enable Client RPC Requests" dates from 2008. Today we use jquery to create browser independant javascript clients using ajax / json. Here is a code snippet to add options: How do I add options to a DropDownList using jQuery?

显示“使用AJAX启用客户端RPC请求”的文档发布于2008年。今天我们使用jquery使用ajax / json创建与浏览器无关的javascript客户端。这是一个添加选项的代码片段:如何使用jQuery向DropDownList添加选项?

#1


0  

loop over the values in the list and create a select tag.
http://www.w3schools.com/tags/tag_select.asp

循环遍历列表中的值并创建一个选择标记。 http://www.w3schools.com/tags/tag_select.asp

#2


0  

The doc showing "Using AJAX to Enable Client RPC Requests" dates from 2008. Today we use jquery to create browser independant javascript clients using ajax / json. Here is a code snippet to add options: How do I add options to a DropDownList using jQuery?

显示“使用AJAX启用客户端RPC请求”的文档发布于2008年。今天我们使用jquery使用ajax / json创建与浏览器无关的javascript客户端。这是一个添加选项的代码片段:如何使用jQuery向DropDownList添加选项?