如何将值发送到弹出窗口
16lz
2021-01-22
How to do this!? : when click on Add open popup windows with 1.php content then when click on Send generate variable and send this variable and replace content 1.php with 2.php
这该怎么做!? :当点击添加打开弹出窗口的1.php内容时,然后单击发送生成变量并发送此变量并将内容1.php替换为2.php
1 个解决方案
#1
0
Two separate click functions, two separate ajax calls. Going on the basis you have an idea of how to create a popup, the following would be the ebb and flow.
两个单独的单击函数,两个单独的ajax调用。在你了解如何创建弹出窗口的基础上,以下将是潮起潮落。
$('#add').click(function(e){
e.preventDefault();
$.ajax({
url: '1.php',
type: 'get',
data: {q : 6} //or $('#someEle').text() for dynamic values of course.
}).done(function(data){
$('#txtHint').html(data);
$('#popup').show();
});
});
//since 'send' seems to be dynamically injected, we need an event handler.
$('#txtHint').on('click', '#send', function(e){
e.preventDefault();
$.ajax({
url: '2.php',
type: 'get',
data: {q : 6}
}).done(function(data){
$('#txtHint').html(data);
//popup is already open, no reason to fire .show() again.
});
});
更多相关文章
- 两个堆叠DIV的顶部DIV如何影响另一个DIV的高度
- 你能得到一个调用类的变量吗?
- Laravel 5 PDO绑定变量数与令牌数不匹配
- 是否可以在ajax中使用动态变量?
- 在Codeigniter中将javascript变量从视图发送到控制器[重复]
- 将Ajax div内容存储在PHP变量中
- 仅在两个字符串之间移除空白。
- Contenteditable / Jquery / Ajax / PHP / mysql - 无法识别URL
- Thinkphp中怎么接收GET变量?