父窗口:

 

<script>
function openWin(str) {
    window.open(siteurl
+"popup/"+str, null,'width=800,height=500'); // 打开窗口

</script> 
<input type="text" id="title" name="picPath" value="<?php if(isset($pic)) {echo $pic['Path'];}?>" /> 
<href="javascript:;" onclick="openWin('searchPic');">图片</a>

 

 

子窗口:

<html>
    
<head>
        
<title>图片搜索</title>
    
</head>
    
<body>
        
<script>
            
function getValue() {
                window.opener.document.getElementById(
'title').value = document.getElementById('picPath').value // 赋值
                window.close(); // 关闭窗口
            }
        
</script>
        
<input type="text" id="picPath" />
        
<input type="button" value="确定" onclick="getValue()" />
    
</body>

</html> 

 

父窗口:

 

<script>
function openWin(str) {
    window.open(siteurl
+"popup/"+str, null,'width=800,height=500'); // 打开窗口

</script> 
<input type="text" id="title" name="picPath" value="<?php if(isset($pic)) {echo $pic['Path'];}?>" /> 
<href="javascript:;" onclick="openWin('searchPic');">图片</a>

 

 

子窗口:

<html>
    
<head>
        
<title>图片搜索</title>
    
</head>
    
<body>
        
<script>
            
function getValue() {
                window.opener.document.getElementById(
'title').value = document.getElementById('picPath').value // 赋值
                window.close(); // 关闭窗口
            }
        
</script>
        
<input type="text" id="picPath" />
        
<input type="button" value="确定" onclick="getValue()" />
    
</body>

</html> 

 

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-11-22
  • 2021-08-10
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2022-02-16
  • 2022-12-23
  • 2021-10-20
相关资源
相似解决方案