Jump to content
  • 0

WYSIWYG вставка гиперссылки


banyman
 Share

Question

Всем здравствуйте!

У меня тут проблема с функцией вставки гиперссылки в визуальном редакторе...

Не сработывает кнопка. Само окно для оформления ссылки открывается, а ссылка не оформляется...

function OpenLink() {
var newWindowFeatures="dependent=1,Height=150,Width=430";
var board=window.open("","InsertLinks",newWindowFeatures);
board.document.open();
board.document.write("<html>");
board.document.write("<head><title>Вставка гиперссылки</title></head>");
board.document.write("<script language=Javascript>function AddLink() { AnCode = '<a href='+document.all.Protocol.value+document.all.Path.value+document.all.Target.value+'>'+window.opener.frames.newTextArea.selection.createRange().text+'</a>'; var range = window.opener.frames.newTextArea.document.selection.createRange(); range.pasteHTML(AnCode); range.select(); range.execCommand(); window.close(); }</script>");
board.document.write("<body topmargin=0 leftmargin=0>");
board.document.write("<input type=button value=Вставить OnClick="AddLink()"></center>");
board.document.write("</body>");
board.document.write("</html>");
board.document.close();

}

У фрейма id="newTextArea"

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy