factorisation of loadEditor for iframe and div