问题
How can I create popup window by jquery to external page that contain a form and get a value from that external page to the parent page when I click a button there?
回答1:
There are lot of plugins for you. So have a look
- jQuery UI Dialog
- Fancy Box
- ColorBox
- Lightbox
- Thickbox - outdated
Also Google in Stack Over Flow
In order to get a value from popup to child
In Parent Page
function SetPopUpData(val){
//your logic here
}
In Popup Page
function SendDataToParent(){
var data='some value';
window.parent.SetPopUpData(data); // this will call the parent page's function
}
回答2:
- For creating the pop-up menu, use Fancy Box plugin.
- For getting the value from the external page, use AJAX to send a request and receive the response asynchronously.
来源:https://stackoverflow.com/questions/14038619/how-can-i-create-popup-window-by-jquery-to-external-page-and-get-a-value-from-it