首先在前台页面中的json数据为
          var recipe = {};
          recipe["name"] = $("#name").val();
          recipe["age"] = $("#age").val();
          recipe["sex"] = $("#sex").val();
          recipe["medicine"] = "{'name': 'a', 'value': 'b'}";

使用ajax的post进行传输

$.ajax({
              type: "post",
              dataType: "json",
              url: "/doctor/recipe/add/",
              data: recipe,
              success: function(Data){
                alert("success")
              }
          });

在django的view中获取

request.POST中的数据为


能够发现medicine下的数据为字符串,可是是unciode格式







相关文章:

  • 2021-11-21
  • 2021-08-06
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-08-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-02
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案