如何通过Javascript创建特定的链接 [英] How to creat specific link by Javascript
本文介绍了如何通过Javascript创建特定的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个编辑器,我想通过Javascript在其中创建链接,如下所示:
我有一个触发Javascript方法的按钮:
Hi every body,
I have an editor and i want to create link in it by Javascript like that:
I have a button that which fire Javascript method:
<asp:Button ID="btnInsertLink" runat="server" Text="Get Link" OnClientClick="GetLink();return false;" />
我有iframe,它将是TextArea:
and i have iframe that which will be the TextArea:
<iframe id='myTextArea' name='iframe' ></iframe>
那就是Javascript方法:
and that is Javascript method:
function GetLink()
{
var vKeyWord = "http://www.codeproject.com";
myTextArea.document.execCommand('createlink', 0 ,vKeyWord);
}
但不适用于我.
but it not work with me.
推荐答案
这是您要尝试执行的操作吗? http://msdn.microsoft.com/en-us/library/ms536419 (v = vs.85).aspx [
Is this what you are attempting to do? http://msdn.microsoft.com/en-us/library/ms536419(v=vs.85).aspx[^]
这篇关于如何通过Javascript创建特定的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文