Forum Moderators: open
var imgTag = 'blah blah blah';
if (document.selection) {
b.focus();
var c = document.selection;
if (c != null) {
var d = c.createRange();
if (d != null) d.pasteHTML(imgTag)
}
}
else if (document.body.innerHTML) {
b.focus();
document.execCommand('insertHTML', false, imgTag)
}
else document.execCommand(v, false, x) I honestly have no idea why I have execCommand() as the elseI got hung up on the two occurrences of b.focus(). If A exists, focus on it and do stuff; if not but there's a B then focus on that and do stuff; and if neither A nor B then just ... uh ... throw stuff in the general direction of the screen and hope it sticks?
I got hung up on the two occurrences of b.focus().
Can we assume v and x (in the "else" line) are defined somewhere or other?