2014-09-29 81 views
0

如何做到這一點!? :當點擊添加開放彈出窗口1.PHP內容,那麼當點擊發送產生變量和發送這個變量和替換內容1.PHP2.PHP如何向彈出窗口發送值

enter image description here

+0

我不知道你的意思,但我會嘗試給你一個提示。查看查詢參數 - 他們可以幫助你 – 2014-09-29 07:50:58

回答

0

兩個獨立的點擊功能,兩個單獨的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. 
    }); 
}); 
相關問題