Re: Insert Hyperlink - another button

  •  05-25-2012, 8:14 AM

    Re: Insert Hyperlink - another button

    Hi Kenneth,
     
    I just call the function "getSelectedHTML()" in "do_INSERT()" function for get the selected value in Editor.
     
    function do_INSERT()
            {
                var browserName = navigator.appName;  
                var editor=Window_GetDialogArguments(window);  
                var httpRequest;
                var FileData;
                var sGetSelectedValue = getSelectedHTML();
            alert(sGetSelectedValue);
                var sMainPath = "www.google.com";
                sImage=document.getElementById('FileName').value;
                if(trim(sGetSelectedValue) != "")
                {
                    FileData = "<div><a target='_blank' href='"+sMainPath+"'>"+trim(sGetSelectedValue)+"</a></div>";
                }
                else
                {
                    FileData = "<div><a target='_blank' href='"+sMainPath+"'>"+
                    "<img height='150' alt='' src='"+sImage+"' width='150' border='0' /><br>click here</a></div>";
                }
            alert(FileData);
                editor.PasteHTML(FileData) ;
               
                if(myWindow != "")
                {
                  myWindow.close();
                }
                Window_CloseDialog(window);
            } 
     
    Thanks,
    raj...
     
     
View Complete Thread