JavaScript Code for Creating Pop-ups in Netscape 4 Browser, Lecture notes of Java Programming

This javascript code snippet includes functions for focusing on a user name input field and creating pop-up windows of predetermined types in netscape 4 browser. The pop-up windows can be of various sizes and types, including help windows and issuezilla assignable users pop-up windows.

Typology: Lecture notes

2011/2012

Uploaded on 08/09/2012

dhanyaa
dhanyaa 🇮🇳

4.7

(3)

60 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
// Write the Netscape 4-specific stylesheet.
if (document.layers) {
document.writeln('<link rel="stylesheet" type="text/css"
href="/branding/css/ns4_only.css" media="screen" />')
}
// Focus on user name input (the "loginform.loginID" field).
function loginfocus() {
if (document.loginform) {
document.loginform.loginID.focus();
}
}
/* Open popup widows of (mostly) predetermined types.
windowURL -- The URL to load in the new browser window.
type -- The (predetermined) type of window to launch.
acceptable values for type:
1: a help window
2: a 400x400 window
3: Issuezilla assignable users popup window
... and you can hard code others yourself inside the function.
atts -- (optional) If the window you wish to create is unique and you
do
not want to set up a "type" for it, or if you want to pass
additional attributes for a certain "type", you can pass its
attributes directly to the function via this parameter.
*/
var tigrisPopupCounter = 0;
function launch(windowURL, type, atts) {
tigrisPopupCounter += 1;
var windowName = 'SourceCast' + type;
if (atts) {
windowName += tigrisPopupCounter;
}
var windowAttributes;
if (type == 1) {
windowAttributes =
'resizable=yes,left=10,top=10,screenX=12,screenY=12,height=485,width=724,
status=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes'
}
else if (type == 2) {
windowAttributes =
'resizable=yes,left=10,top=10,screenX=12,screenY=12,height=400,width=400'
;
}
else if (type == 3) {
docsity.com
pf2

Partial preview of the text

Download JavaScript Code for Creating Pop-ups in Netscape 4 Browser and more Lecture notes Java Programming in PDF only on Docsity!

// Write the Netscape 4-specific stylesheet. if (document.layers) { document.writeln('') }

// Focus on user name input (the "loginform.loginID" field). function loginfocus() { if (document.loginform) { document.loginform.loginID.focus(); } }

/* Open popup widows of (mostly) predetermined types.

windowURL -- The URL to load in the new browser window. type -- The (predetermined) type of window to launch. acceptable values for type: 1: a help window 2: a 400x400 window 3: Issuezilla assignable users popup window ... and you can hard code others yourself inside the function. atts -- (optional) If the window you wish to create is unique and you do not want to set up a "type" for it, or if you want to pass additional attributes for a certain "type", you can pass its attributes directly to the function via this parameter. */

var tigrisPopupCounter = 0;

function launch(windowURL, type, atts) { tigrisPopupCounter += 1;

var windowName = 'SourceCast' + type; if (atts) { windowName += tigrisPopupCounter; }

var windowAttributes; if (type == 1) { windowAttributes = 'resizable=yes,left=10,top=10,screenX=12,screenY=12,height=485,width=724, status=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes' } else if (type == 2) { windowAttributes = 'resizable=yes,left=10,top=10,screenX=12,screenY=12,height=400,width=400' ; } else if (type == 3) {

docsity.com

windowAttributes = 'resizable=yes,left=10,top=10,screenX=12,screenY=12,height=440,width=600, scrollbars=yes'; } if (atts) { windowAttributes += ',' + atts; }

var windowObj = window.open(windowURL, windowName, windowAttributes);

if (windowObj) { return false; } else { return true; } }

docsity.com