A
AwefulService
The following code was from one of the posts, its caller looks like
this:
<form ...
<input type="button" name="txtBold" onclick="insert_link('noteid2');"
value="Link">
....
</form>
however, the caller failed with FireFox 2. Is it because of the
setup/config with my FF2 or?
With IE7, the caller works, however, a URL length exceeds about 50
chars, the link's "head" and "tail" would be chopped off, that is, no
<a and no /a>, hence, rendering it unusable. How come? Any way to
fix it?
Many thanks.
function insert_link(e) {
var str = document.selection.createRange().text;
document.getElementById(e).focus();
var my_link = prompt("Enter URL:","http://");
if (my_link != null) {
var sel = document.selection.createRange();
sel.text = "<a href=\"" + my_link + "\" target=_new>" + str + "</a>";
}
return;
}
this:
<form ...
<input type="button" name="txtBold" onclick="insert_link('noteid2');"
value="Link">
....
</form>
however, the caller failed with FireFox 2. Is it because of the
setup/config with my FF2 or?
With IE7, the caller works, however, a URL length exceeds about 50
chars, the link's "head" and "tail" would be chopped off, that is, no
<a and no /a>, hence, rendering it unusable. How come? Any way to
fix it?
Many thanks.
function insert_link(e) {
var str = document.selection.createRange().text;
document.getElementById(e).focus();
var my_link = prompt("Enter URL:","http://");
if (my_link != null) {
var sel = document.selection.createRange();
sel.text = "<a href=\"" + my_link + "\" target=_new>" + str + "</a>";
}
return;
}