【发布时间】:2020-01-22 03:03:52
【问题描述】:
Using this code:
Swal.mixin({
input: 'text',
confirmButtonText: 'Next →',
showCancelButton: true,
progressSteps: ['1', '2', '3']
}).queue([
{
title: 'Question 1',
text: 'Chaining swal2 modals is easy'
},
'Question 2',
'Question 3'
]).then((result) => {
if (result.value) {
const answers = JSON.stringify(result.value)
Swal.fire({
title: 'All done!',
html: `
Your answers:
<pre><code>${answers}</code></pre>
`,
confirmButtonText: 'Lovely!'
})
}
})
在这种情况下,我的回答:
["1","1","2"]
它怎么会接收到一个php文件中传入的值呢? 我对这两个主题都不太了解,但我正在经历这种需求。 对不起,对不起我的英语。
【问题讨论】:
-
如果我理解正确你在
php文件中有数据并且你想在你的js 代码中获取它所以你需要使用ajax搜索它 -
@Joseph 实际上,我想将这些数据从该代码传递给 PHP。我只是不太明白如何做到这一点。你能指导我吗?我搜索这个,发现这个帖子:stackoverflow.com/questions/50847738/… 只有没有任何解决方案。
标签: javascript php arrays json sweetalert2