Passing variables between Python and Javascript

后端 未结 2 1517
没有蜡笔的小新
没有蜡笔的小新 2021-02-02 16:39

Imagine that you need to write some Javascript that simply changes a set of checkboxes when a drop down list is changed.

Depending on which item is selected in the list,

2条回答
  •  被撕碎了的回忆
    2021-02-02 17:16

    python has a json module, which is a perfect fit for this scenario.

    using a good old AJAX, with json as the data format will allow you to exchange data between javascript and your python module.

    (unless your python module is running on the client side, but then i don't see how you could execute it from the browser...)

提交回复
热议问题