IE8 Gets Absolute URL For Image Added From Image Manager

2 posts, 1 answers
  1. Amy
    Amy avatar
    4 posts
    Member since:
    Apr 2006

    Posted 13 Apr Link to this post

    When using IE8, if I add an image to the content in the editor via the Image Manager, the SRC attribute gets an absolute URL. I can reproduce this on your demo at 

    When using IE9 or higher, the SRC gets a virtual path, which is what we want.

    Is there a way to make IE8 get a virtual path?

  2. Answer
    Joana avatar
    69 posts

    Posted 18 Apr Link to this post

    Hello Amy,

    You could implement a custom content filter to convert the absolute URLs into relative ones. You could find more information here in our documentation.

    For your convenience, I have prepared a sample filter that could be used:

    <script type="text/javascript">
         function OnClientLoad(editor, args)
             editor.get_filtersManager().add(new ConvertToVirtualPath());
         ConvertToVirtualPath = function ()
             this.set_name("RadEditor ConvertToVirtualPath filter");
             this.set_description("RadEditor ConvertToVirtualPath filter description");
         ConvertToVirtualPath.prototype =
             getHtmlContent: function(content)
                 var regExp = new RegExp("src=[\"'](.+?)[\"'].*?", "gi");
                 var newContent = content.replace(regExp, function(match, offset, fullText)
                     return match.replace("http://" +, "");
                 return newContent;
         ConvertToVirtualPath.registerClass('ConvertToVirtualPath', Telerik.Web.UI.Editor.Filter);

    Set the OnClientLoad event of the RadEditor and add the new filter.

    I hope this will help you achieve your scenario.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
Back to Top