如何向父窗口的组件添加字符
How to append characters to the parent window's component
我有一个链接,当它点击时,它打开了另一个浏览器窗口(specialchar .php)
function popup_specialChars()
{
var ht;
if(window.navigator.appVersion.indexOf("MSIE 5.01") == -1)
ht = 300;
else
ht = 720;
specialCharsWindow = window.open
(
"/TradeScienceJournalSystem/specialChars.php", "special_characters",
"resizable=yes,scrollbars=yes,height=" + ht + ",width=650,dependent=yes,alwaysRaised=yes"
);
specialCharsWindow.focus();
}
<a href="javascript:popup_specialChars();" class="special">Insert Special Character</a>
<textarea name="docArticleTitle" cols="60" rows="14"></textarea>
specialChars.php
function insert_text(str)
{
alert(str);
opener.append(str); // Not working
this.window.focus();
}
<table border="1" id="table1" width="97%">
<tr>
<td align="center" class="specialcharlink"><a href="javascript:insert_text('á')"><span class="specialchar">á</span></a></td>
</tr>
</table>
当一个带有特殊字符的链接被点击时,insert_text()将被调用。而alert则表现出了它的特殊性。但我想把那个字符附加到打开器窗口的文本区域。但是它不工作。
如何表示打开器窗口的文本区域?
给textarea一个id
<textarea name="docArticleTitle" id="id1" cols="60" rows="14"></textarea>
和改变
function insert_text(str)
{
window.opener.document.getElementById('id1').value += str;
this.window.focus();
}
并开始向文本区域追加字符
相关文章:
- 如何定义组件添加到DataItem的顺序
- React:向现有组件添加道具
- 向React中的高阶组件添加方法
- 在 React 中向组件添加新输入并跟踪状态
- Angular2 - 尝试将组件从父组件添加到子组件中
- extjs4 - 将自定义组件添加到容器
- 将react组件添加到contenteditable或innerhtml
- 反应多个组件添加项目
- 如何向 ReactJS 组件添加多个类
- 可以't将组件添加到dojox/layout/GridContainer
- KnockoutJs组件-添加默认类
- 如何使用React.js而不是JQuery.js克隆React组件(添加到其他地方)
- 向动态创建的组件添加事件绑定
- 如何在rteplugins下为richtext组件添加图像插件
- 为每个reactJS组件添加组件
- 如何向父窗口的组件添加字符
- React:如何给库中的组件添加一个props
- Highcharts提示?如何向hiccharts DOM组件添加类或id ?
- 用于向组件添加多个订阅的React mixin
- 如何在vue.js中为动态组件添加道具