JavaScript Tip of the Week for November 4, 1996: "JavaScript, Say Hello to ActiveX" | Source Code | WebReference

JavaScript Tip of the Week for November 4, 1996: "JavaScript, Say Hello to ActiveX" | Source Code

JavaScript Tip of the Weekfor November 4, 1996: Source Code: "JavaScript, Say Hello to ActiveX"

Simple ActiveX Popup Menu
Relational ActiveX Popup Menu
Hotlinked ActiveX News Ticker



This code is put in the HTML document where you want the popup menu to reside. This is identical to the code that was used in this week's tip:
<HTML>
<HEAD>
<TITLE>JavaScript Tip of the Week for November 4, 1996: "JavaScript, Say Hello to ActiveX"</TITLE>
<SCRIPT LANGUAGE="JavaScript">
/* This code is Copyright (c) 1996 Nick Heinle and Athenia Associates, 
 * all rights reserved. In order to receive the right to license this 
 * code for use on your site the original code must be copied from the
 * Web site webreference.com/javascript/. License is granted to user to 
 * reuse this code on their own Web site if and only if this entire copyright
 * notice is included. Code written by Nick Heinle of webreference.com.
 */
function makeItem (desc, url) {
this.desc = desc;
this.url = url;
}
function newItem(desc, url) {
menuItems[num] = new makeItem (desc, url)
Pop1.AddItem(menuItems[num].desc)
num++;
}
function Pop1_Click(item) {
        if (menuItems[item - 1].url != null) window.location = menuItems[item - 1].url;
}
function init() {
newItem ('Tip Repository', '../tip_week_past.html');
newItem ('This Week\'s Tip', '../this_week/index.html');
newItem ('E-Mail', '../e-mail.html');
newItem ('Tippettes', '../tippettes.html');
newItem ('Awards', '../awards.html');
}
var num = 0;
var menuItems = new Array();
</SCRIPT>
</HEAD>
<BODY onLoad = "init()"  BGCOLOR = "#FFFFFF" TEXT = "#000000" LINK = "#B8860B" ALINK = "#8B0000" VLINK = "#B8860B">
<IMG HEIGHT = 137 WIDTH = 172 SRC = "../tip_week.gif" ALT = "JavaScript Tip of the Week">
<BLOCKQUOTE>
<FONT SIZE = 4 FACE = "Times">for November 4, 1996: Simple ActiveX Popup Menu</FONT>
<OBJECT 
 ID = "Pop1"
 WIDTH = 0
 HEIGHT = 0
 CODEBASE = "http://activex.microsoft.com/controls/iexplorer/iemenu.ocx#Version=4,70,0,1161"
 CLASSID = "CLSID:7823A620-9DD9-11CF-A662-00AA00C066D2">
     <PARAM NAME = "enable" VALUE = "1">
</OBJECT>
<FORM>
<INPUT TYPE="BUTTON" NAME="JumpButton" VALUE="Jump to" onClick = "Pop1.PopUp()">
</FORM>
</BLOCKQUOTE>
</BODY>
</HTML>
This code is put in the HTML document where you want the relational popup menus to reside. This is identical to the code that was used in this week's tip:
<HTML>
<HEAD>
<TITLE>JavaScript Tip of the Week</TITLE>
<SCRIPT LANGUAGE="JavaScript">
/* This code is Copyright (c) 1996 Nick Heinle and Athenia Associates, 
 * all rights reserved. In order to receive the right to license this 
 * code for use on your site the original code must be copied from the
 * Web site webreference.com/javascript/. License is granted to user to 
 * reuse this code on their own Web site if and only if this entire copyright
 * notice is included. Code written by Nick Heinle of webreference.com.
 */
function makeItem (desc, url) {
this.desc = desc;
this.url = url;
}
function newItem(desc, url) {
menuItems[num] = new makeItem (desc, url)
Pop2.AddItem(menuItems[num].desc)
num++;
}
function newCat(desc) {
Pop1.AddItem(desc)
}
function Pop1_Click(item) {
num = 0;
        for (i = menuItems.length; i > 0 ; i--) Pop2.RemoveItem(i)
        if (item == 1) {
        newItem ('Tip Repository', '../tip_week_past.html');
        newItem ('This Week\'s Tip', '../this_week/index.html');
        newItem ('E-Mail', '../e-mail.html');
        newItem ('Tippettes', '../tippettes.html');
        newItem ('Awards', '../awards.html');
        }
        if (item == 2) {
        newItem ('The Hut', '../thehut/jtotw_intro.html');
        newItem ('JavaScript and ActiveX', '../activex/index.html');
        newItem ('Beginner\'s Guide', '../guide/index.html');
        }
        if (item == 3) {
        newItem ('Netscape Handbook', 'http://home.netscape.com/eng/mozilla/3.0/handbook/javascript/index.html');
        newItem ('JavaScript Index', 'http://www.c2.org/~andreww/javascript/');
        newItem ('Live Software', 'http://jrc.livesoftware.com');
        }
        if (item == 4) {
        newItem ('Highligthed Image Menus', '../960930/index.html');
        newItem ('Modifiable Select Menus', '../960902/select_boxes.html');
        newItem ('Eye Catching Intros', '../961028/part02.html');
        newItem ('Browser Compatibility', '../961104/index.html');
        }
}
function Pop2_Click(item) {
        if (menuItems[item - 1].url != null) window.location = menuItems[item - 1].url;
}
function init() {
newCat ('Tip Related');
newCat ('More JavaScript');
newCat ('JavaScript Sites');
newCat ('Favorite Tips');
newItem ('Tip Repository', '../tip_week_past.html');
newItem ('This Week\'s Tip', '../this_week/index.html');
newItem ('E-Mail', '../e-mail.html');
newItem ('Tippettes', '../tippettes.html');
newItem ('Awards', '../awards.html');
}
var num = 0;
var menuItems = new Array();
var menuCats = new Array();
</SCRIPT>
<OBJECT 
 ID = "Pop1"
 WIDTH = 0
 HEIGHT = 0
 CODEBASE="http://activex.microsoft.com/controls/iexplorer/iemenu.ocx#Version=4,70,0,1161"
 CLASSID="CLSID:7823A620-9DD9-11CF-A662-00AA00C066D2">
        <PARAM NAME="enable" VALUE="1">
        <PARAM NAME="ScreenX" VALUE="400">
        <PARAM NAME="ScreenY" VALUE="400">
</OBJECT>
<OBJECT 
 ID = "Pop2"
 WIDTH = 0
 HEIGHT = 0
 CODEBASE="http://activex.microsoft.com/controls/iexplorer/iemenu.ocx#Version=4,70,0,1161"
 CLASSID="CLSID:7823A620-9DD9-11CF-A662-00AA00C066D2">
        <PARAM NAME="enable" VALUE="1">
        <PARAM NAME="ScreenX" VALUE="400">
        <PARAM NAME="ScreenY" VALUE="400">
</OBJECT>
</HEAD>
<BODY onLoad = "init()" BGCOLOR = "#FFFFFF">
<FORM>
<INPUT TYPE="BUTTON" NAME="Category" VALUE="Category" onClick = "Pop1.PopUp()">
<INPUT TYPE="BUTTON" NAME="Page" VALUE="Page" onClick = "Pop2.PopUp()">
</FORM>
</BODY>
</HTML>