Can I use Javascript to display a displays hidden content in new window?

Discussion in 'JavaScript' started by Skinny, Apr 3, 2007.

  1. #1
    If I have a div (let's say div id = "hidden") and it is hidden using css.

    Can I use javascript to open a new window and then have it display div id="hidden"?

    Skinny
     
    Skinny, Apr 3, 2007 IP
  2. cjburkha

    cjburkha Peon

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes.

    I wont write all the code for you, but start at http://www.quirksmode.org/js/croswin.html this is good for parent and child windows.

    esp the opener object as in alert(opener.location.href); from the child window
     
    cjburkha, Apr 14, 2007 IP
  3. Subikar

    Subikar Active Member

    Messages:
    241
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    <SCRIPT LANGUAGE="JavaScript">
    <!-- hide this script from old browsers

    // This script opens a new browser window and writes
    // HTML to display an image with a title and caption

    function show_photo( pFileName, pTitle, pCaption) {

    // specify window parameters
    photoWin = window.open( "", "photo",
    "width=600,height=450,status,scrollbars,resizable,
    screenX=20,screenY=40,left=20,top=40");

    // wrote content to window
    photoWin.document.write('Hidden content fetch from hidden field and then diplay from here');

    photoWin.document.close();

    // If we are on NetScape, we can bring the window to the front
    if (navigator.appName.substring(0,8) ==
    "Netscape") photoWin.focus();
    }
    // done hiding from old browsers -->
    </SCRIPT>



    This is the script it will work for you. Happy coding and enjoy. :)
     
    Subikar, Apr 17, 2007 IP