Lord_Garfield
04-12-2005, 08:00 AM
Hi,
I have a problem with a linkinsertor. I can not manage to paste HTML code in a Iframe in firefox. It all works in IE but not Firifox.
the function fill_exlinkn works.
It simply gets the selected text if there is selcted text and puts it in a variable. This will be used between the 'a' tags.
form1.exlinkn.value is a textbox in this pop up window where you can still change the external link name.
the other function submit_link does not work in FF.
What should I do to get it work in FF?
what is the correct replacement for
window.opener.frames[naam].focus();
selection.pasteHTML(exlink);
here is my function code:
var naam = "<?php echo $_GET['naam']; ?>";
var selection;
var isFF;
function fill_exlinkn()
{
var ua = navigator.userAgent.toLowerCase();
isFF = (ua.indexOf("gecko") != -1);
if (!isFF)
{
selection = window.opener.frames[naam].document.selection.createRange();
exlinknaam = selection.text;
}
else
{
//window.opener.document.getElementById(naam).contentWindow.focus();
selection = window.opener.document.getElementById(naam).contentWindow.getSelection();
exlinknaam = selection;
}
document.form1.exlinkn.value = selection;
}
function submit_link()
{
if (document.form1.exlinkn.value == "")
{
exlink = "<a href=" + form1.link_type.value + form1.exlink.value + " target=_blanc>" + form1.exlink.value + "</a>";
}
else
{
exlink = "<a href=" + form1.link_type.value + form1.exlink.value + " target=_blanc>" + form1.exlinkn.value + "</a>";
}
if (!isFF)
{
window.opener.frames[naam].focus();
selection.pasteHTML(exlink);
}
else
{
window.opener.document.getElementById(naam).contentWindow.focus();
window.opener.document.getElementById(naam).contentWindow.getSelection().pasteHTML(exlink);
}
window.close();
}
best regards.
I have a problem with a linkinsertor. I can not manage to paste HTML code in a Iframe in firefox. It all works in IE but not Firifox.
the function fill_exlinkn works.
It simply gets the selected text if there is selcted text and puts it in a variable. This will be used between the 'a' tags.
form1.exlinkn.value is a textbox in this pop up window where you can still change the external link name.
the other function submit_link does not work in FF.
What should I do to get it work in FF?
what is the correct replacement for
window.opener.frames[naam].focus();
selection.pasteHTML(exlink);
here is my function code:
var naam = "<?php echo $_GET['naam']; ?>";
var selection;
var isFF;
function fill_exlinkn()
{
var ua = navigator.userAgent.toLowerCase();
isFF = (ua.indexOf("gecko") != -1);
if (!isFF)
{
selection = window.opener.frames[naam].document.selection.createRange();
exlinknaam = selection.text;
}
else
{
//window.opener.document.getElementById(naam).contentWindow.focus();
selection = window.opener.document.getElementById(naam).contentWindow.getSelection();
exlinknaam = selection;
}
document.form1.exlinkn.value = selection;
}
function submit_link()
{
if (document.form1.exlinkn.value == "")
{
exlink = "<a href=" + form1.link_type.value + form1.exlink.value + " target=_blanc>" + form1.exlink.value + "</a>";
}
else
{
exlink = "<a href=" + form1.link_type.value + form1.exlink.value + " target=_blanc>" + form1.exlinkn.value + "</a>";
}
if (!isFF)
{
window.opener.frames[naam].focus();
selection.pasteHTML(exlink);
}
else
{
window.opener.document.getElementById(naam).contentWindow.focus();
window.opener.document.getElementById(naam).contentWindow.getSelection().pasteHTML(exlink);
}
window.close();
}
best regards.