【问题标题】:Express.js : get req.body.datas of an same source iframeExpress.js : 获取同源 iframe 的 req.body.data
【发布时间】:2018-05-03 12:34:36
【问题描述】:

因为嵌套表单是一种不好的做法,我从我的网站源中制作了一个内部 iframe,用于加载另一个表单。因为它的内部我已经添加了样式和所有内容,但是在发布槽快递时(我也使用 sequelize 创建我的实体),即使加载了返回页面,我的数据也是空的。有什么我想念的吗?也许我必须指定 req.accepts(),我在问是否有人知道这种问题。

app.post('/sendOwners', function (req, res) {
  ownerController
//these are empty even filled from the front end
     .create(req, res, req.body.name,req.body.firstname, req.body.civility) 
     .then(function(owner){
        res.send('contenu owner' +owner +'contenu req:'+req.body)
     })
})

我的 iframe

  <iframe id="iframeID"
          name="_parent"
          sandbox="allow-forms allow-same-origin"
          src="owners"
   ></iframe>

【问题讨论】:

  • 也许问题是:如何使用 express 解析 iframe 中的数据?

标签: javascript express iframe server sequelize.js


【解决方案1】:

我没有在网上找到关于这个主题的明确回复。我必须找到一种方法,几个小时后我终于将方法形式更改为“获取”并使用 req.query 来访问我的数据。现在好像可以了。

【讨论】:

    猜你喜欢
    • 2011-11-29
    • 1970-01-01
    • 2018-11-14
    • 2012-02-24
    • 2019-03-11
    • 2015-11-30
    • 1970-01-01
    • 2017-10-20
    • 2011-02-11
    相关资源
    最近更新 更多