Microsoft KB Archive/272163

= HOW TO: Open a Custom Child Window from a Hyperlink in FrontPage 2000 =

Article ID: 272163

Article Last Modified on 7/4/2007

-

APPLIES TO


 * Microsoft FrontPage 2000 Standard Edition

-



This article was previously published under Q272163



IN THIS TASK
SUMMARY
 * Child Window Sample Code

REFERENCES



SUMMARY
This article describes how to use Dynamic Hypertext Markup Language (DHTML) to open a child window of a custom size by using JScript/JavaScript when a hyperlink is clicked. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. NOTE: You may receive an error message if you copy the examples directly from this article and paste them into FrontPage. The angle brackets may appear as escaped HTML code. To work around this behavior, paste the script into a blank Notepad document, and then copy it from Notepad before you paste it into FrontPage.

back to the top

Sample 1
The following code sample demonstrates how to open a custom-sized child window from a hyperlink by using script code that is tied to the &quot;onClick&quot; event of the hyperlink. DHTML URLs 1  Microsoft MSDN  Although the preceding code example is concise, it has the following limitations:
 * It requires script code to be entered for each hyperlink on your page, and each hyperlink must be to the current page, listed as &quot;#&quot;, to prevent double-browsing to the new page.
 * It offers no backward compatibility with older browsers; therefore, older browsers will only reload the current page.

Sample 2
The following code sample takes the problems in Sample 1 into account through the following:
 * It allows you to create normal hyperlink tags to other pages with the &quot;_blank&quot; frame tag. This opens a new window on most older browsers.
 * It provides three DHTML functions that detect when a user is resting a mouse on a hyperlink, and, if so, the code sample changes the URL of the hyperlink to the current page and sets a variable to the destination of the hyperlink. Therefore, when the hyperlink is clicked, another DHTML function opens the child window. In addition, when a user is no longer resting the mouse on the hyperlink, a third DHTML function changes the hyperlink's URL back to its original value.

DHTML URLs 2 

  <a target=&quot;_blank&quot; href=&quot;http://www.microsoft.com&quot;>Microsoft</a></li> <a target=&quot;_blank&quot; href=&quot;http://msdn.microsoft.com&quot;>MSDN</a></li> </ul> back to the top

<div class="references_section">