0

我有一个使用 window.open(url) 打开的远程 url,在该页面中有一个 textarea,我想从我的父页面更改该 textarea 的值。

window.open("http://facebook.com/share.php?u=
                http://something.com&t="+txt,'facebook','height=400,width=550'); 

$("textarea#u_0_6").val('test');

谢谢你

4

1 回答 1

0

也许你可以这样做。方法很简单,你可以像这样用哈希(#)传递你的值;

window.open("http://facebook.com/share.php?u=
                http://something.com&t="+txt+"#this is my textarea value",'facebook','height=400,width=550'); 

 $(function() {
   var MyTextAreaValue = window.location.hash;
   $('#u_0_6').val(MyTextAreaValue);
 });
于 2013-02-22T12:24:54.723 回答