How can I create popup window by jquery to external page and get a value from it to the parent page when I click a button there?

孤人 提交于 2019-12-08 06:22:30

问题


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

  1. jQuery UI Dialog
  2. Fancy Box
  3. ColorBox
  4. Lightbox
  5. 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:


  1. For creating the pop-up menu, use Fancy Box plugin.
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!