Selecting an Image For Use With Custom Links Dialog

  •  04-03-2006, 9:05 PM

    Selecting an Image For Use With Custom Links Dialog

    I am upgrading from CE 3.0 to CE 5.2.
    In CE 3.0 I had a custom Insert Link dialog fully functional. I now have it working in CE 5.2 except that when I select an image and then click on the Link button (which shows my custom dialog), I get a JavaScript error ("Object doesn's support this property or method"). I am trying have the ability to make a selected image into a hyperlink.
     
    I have narrowed the problem down to this client-side script which I pulled from the CE 3.0 WinIE.js file. I am now trying to use it in my CE 5.2 implementation but it fails:
    if (IsImage){
     var oTextRange = document.body.createTextRange() ;
     oTextRange.moveToElementText(selectedRange.item(0)) ;
     selectedRange = oTextRange;
     selectedRange.select();
    }
     
    My question: How can I modify that code so that it does its job with CE 5.2?
     
    Thanks!
View Complete Thread