tags:

views:

38

answers:

1

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

A: 
<script>
var w = window.open('', 'wnd');

w.document.body.innerHTML = "<b>Hello, stackoverflow!</b>";
</script>
Sergei Stolyarov
This code is also not working for Firefox.......
B. Kumar