How to open new window and write data into that

Posted by B. Kumar on Stack Overflow See other posts from Stack Overflow or by B. Kumar
Published on 2010-06-11T05:49:26Z Indexed on 2010/06/11 5:52 UTC
Read the original article Hit count: 226

Filed under:

I want to write some selected date in another window. For that i wrote JavaScript code like that....

        function Writer()
        {
            winobj=window.open('','','toolbar=no,status=no,scrollbars=yes,width=800,height=600');
            var txt='';
            if(document.selection)
            {
                txt = document.selection.createRange().text
                winobj.document.selection.createRange().text = txt;
            }
            else 
            {
                return
            }
        }   

This function working well with Internet Explorer but not working with Firefox or Crome.... Anyone plz modify this code or plz suggest me another code so that i can work with all browser.

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript