[workaround] IE8 + execCommand + createLink = Not working


I was trying to generate a link, and open a custom user interface to generate eventualy the src of the link, but for some reason IE8 wasn´t generating the link using execCommand. But the createImage command WAS working… so my workaround was this (i was using t his from inside a NiceEdit plugin)

 

 

        this.ne.nicCommand("insertImage", "dummy");
        
        var hook = $("<a href='#' class='hidden'></a>").appendTo("body");
        
        $("img[src='dummy']").after( hook ).remove();

from that point on, i have a reference to the created link, and i can do whatever i want with it.

Advertisements