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.
    });
});

更多相关文章

  1. 两个堆叠DIV的顶部DIV如何影响另一个DIV的高度
  2. 你能得到一个调用类的变量吗?
  3. Laravel 5 PDO绑定变量数与令牌数不匹配
  4. 是否可以在ajax中使用动态变量?
  5. 在Codeigniter中将javascript变量从视图发送到控制器[重复]
  6. 将Ajax div内容存储在PHP变量中
  7. 仅在两个字符串之间移除空白。
  8. Contenteditable / Jquery / Ajax / PHP / mysql - 无法识别URL
  9. Thinkphp中怎么接收GET变量?

随机推荐

  1. Android浏览器如何打开本地html文件
  2. 设置行距
  3. Android mvvm使用实战
  4. Android -- 生命周期
  5. [Android]Android数据的四种存储方式
  6. 在Android关机中插入脚本
  7. Android之Input子系统事件分发流程
  8. Android状态机
  9. Android 支持的 media 文件格式--MediaFi
  10. 5.ScrollView无法填充满屏幕