Pass text to popup window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Treetop

    Pass text to popup window

    I would like to pass text to a popup window to save creating a new
    html file for each help topic.
    I would like to have a value for the heading, a value for the text,
    code for printing the help page, and code to close the window.

    ------------------------------------------
    the help window code is following

    <SCRIPT LANGUAGE="JavaS cript">
    <!-- Begin
    function printWindow() {
    bV = parseInt(naviga tor.appVersion) ;
    if (bV >= 4) window.print();
    }
    // End -->
    </script>

    </head>
    <body>
    <h1 align="center"> How to View Results</h1>

    <ol>
    <li>Locate the Application
    <li>Leave your mouse over the application and the
    popup window displayed
    <li>Press the Page Down button on your keyboard
    </ol>

    <br><br>
    <table width="100%"><t r><td>
    <a href="javascrip t:printWindow() ">
    Print This Help Page</a>
    </td><td align="right">
    <a href="javascrip t:onclick=windo w.close()">
    Close This Help Page</a>
    </td></tr></table>


    ------------------------------------------------
    Currently I use the following code for a popup.

    <script language="JavaS cript">
    function popup(theURL){
    window.open(the URL,"pop","heig ht=300,width=30 0")
    }
    </script>


    <a href="bfmenu.ht ml" value="tip_prin t.html"
    onClick="popup( this.value)">Pr int</a>...

    <a href="bfmenu.ht ml" value="tip_view .html"
    onClick="popup( this.value)">Vi ew entire results</a>...





  • kaeli

    #2
    Re: Pass text to popup window

    In article <8cfaa2a8e61f9f 79cb79a472be949 dd9@news.terane ws.com>,
    treetop@netfron t.net enlightened us with...[color=blue]
    > I would like to pass text to a popup window to save creating a new
    > html file for each help topic.
    > I would like to have a value for the heading, a value for the text,
    > code for printing the help page, and code to close the window.
    >[/color]

    Want mine?

    It uses a javascript array for help menu values and the call tells which
    menu to open.
    The window is reused if open. The window document is written dynamically
    with the text value in the array.

    You can add simple code to close it (or print it) with a link. My users
    know how to click on the 'x'. :)

    --
    --
    ~kaeli~
    You feel stuck with your debt if you can't budge it.



    Comment

    • Treetop

      #3
      Re: Pass text to popup window

      I would love it. If you would prefer to E-Mail it to me (remove
      nospam)
      bfalk@nospamsof thome.net


      "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
      news:MPG.1a689e d845cdfa9c989aa 9@nntp.lucent.c om...[color=blue]
      > In article <8cfaa2a8e61f9f 79cb79a472be949 dd9@news.terane ws.com>,
      > treetop@netfron t.net enlightened us with...[color=green]
      > > I would like to pass text to a popup window to save creating a new
      > > html file for each help topic.
      > > I would like to have a value for the heading, a value for the[/color][/color]
      text,[color=blue][color=green]
      > > code for printing the help page, and code to close the window.
      > >[/color]
      >
      > Want mine?
      >
      > It uses a javascript array for help menu values and the call tells[/color]
      which[color=blue]
      > menu to open.
      > The window is reused if open. The window document is written[/color]
      dynamically[color=blue]
      > with the text value in the array.
      >
      > You can add simple code to close it (or print it) with a link. My[/color]
      users[color=blue]
      > know how to click on the 'x'. :)
      >
      > --
      > --
      > ~kaeli~
      > You feel stuck with your debt if you can't budge it.
      > http://www.ipwebdesign.net/wildAtHeart
      > http://www.ipwebdesign.net/kaelisSpace
      >[/color]


      Comment

      • kaeli

        #4
        Re: Pass text to popup window

        In article <2a7aa2e5ec3b43 5dfc4d56f4825cb bc7@news.terane ws.com>,
        treetop@netfron t.net enlightened us with...[color=blue]
        > I would love it. If you would prefer to E-Mail it to me (remove
        > nospam)
        > bfalk@nospamsof thome.net
        >[/color]

        It's not all that big (well, I took out all but two of my help screens
        for the sake of example; the real file is quite long with a help screen
        for every form field). Watch for word wrap.
        Note: tested in IE5+/NN4+/Moz1.2 only. Some functions may not work in
        other browsers. This is used for an intranet app where I know my users,
        so if you don't, add error checking and fallback. However, I'm not doing
        anything fancy, and I use the evil javascript: in a link so it works in
        NN4 (no onClick of image in NN4).

        File 1: jsHelp.js: put help descriptions in here like you see with the
        basic "help" and "h_qty". Note that all my "Screens" except "help" begin
        with "h_" to keep var names unique, as many js files are included in the
        site.

        -----------------------
        /*jsHelp.js
        Has help functions

        var h_window = null;
        var h_array = new Array();
        /* descriptions that remain constant */
        h_array["help"] = "<p>Click on any of the help icons to bring up a
        javascript window "+
        "with relevant information.</p>";
        h_array["h_qty"] = "<h1>Quanti ty</h1>" +
        "<p>Description : the number of this item in this
        order. Left blank, the quantity will be 1.</p> ";

        // put more below this

        /* functions that get called when user presses a help button */
        function openHelp(screen Name)
        {
        if (!h_window || h_window == null || typeof h_window == "undefined" ||
        h_window.closed || !h_window.docum ent)
        h_window = window.open("", "Help","height= 200,width=
        200,scrollbars= yes,resizable=y es");
        var doc = h_window.docume nt;
        doc.open();
        doc.writeln("<h tml><head><titl e>Help</title>");
        doc.writeln("<l ink rel='stylesheet ' type='text/css'
        href='myStylesh eet.css'>");
        doc.writeln("</head><body>");
        doc.writeln(h_a rray[screenName]);
        // add close and / or print links/buttons here
        doc.writeln("</body></html>");
        doc.close();
        h_window.focus( );
        return;
        }

        /* end jsHelp.js */

        ----------------------------

        in the html file, in the head
        <script language="javas cript" type="text/javascript"
        src="jsHelpFunc tions.js"></script>

        in the body...
        I use a help icon for the users to click on. Modify as appropriate.
        <a href="javascrip t:openHelp('hel p)"><img src="help.gif" width="15"
        height="15" border="0"></a>
        If using new browsers only, change to onClick of image, which is better.
        Old NN doesn't support that and not sure on Opera support.

        To make a close button or link, use self.close().
        To mail, use self.print() (I think).
        You would add that to what gets printed in the window by adding it in
        the help file where I put that comment in.

        HTH

        --
        --
        ~kaeli~
        Once you've seen one shopping center, you've seen a mall.



        Comment

        Working...