wdvlTalk Roundup August 2002 Page 31
September 3, 2002
I need a mouseover function to act the same way an Alt attribute
in the anchor tag works when I create a link to a text. Something
like a more detailed description of the word/text. IS it
possible in Javascript?
Has anyone set up password protection on a site hosted on IIS?
-
IIS has a built in function to deal with directory password
protection, but you can only assign one generic password and
username, so I don't know if this suits your needs.
This is from memory, so hopefully it serves me fully:
Connect to IIS, locate the directory you wish to protect, right
click it, select properties. Click the directory security tab
and at the top uncheck anonymous access, this ungrays three more
options: simple password verification, something else (don't recall
what it is called and its only in IIS 5) and windows
authentication. The simple password verification is what I have
used, but the drawback is that it sends the pass/user in
unencrypted text. The windows authentication has the drawback
of not needing a password from within the domain. Also, there is
an advanced(?) button beside the simple password verification
that pops up a window which you can enter the domain into, so
the user does not have to preface the username with "MyDomain\"
-
For IIS you should use asp see
http://www.evolt.org/article/Creating_a_login_script_with_ASP/17/28652/index.html
Or if you don't want to create your own you can always use
http://www.asplogin.com/index.html (freeware up to 100 users $49 for up
to 1000)
-
Google is a wonderful place. ;)
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=%22password+protection%22+server+IIS+tutorial
I'd like to put a button on some pages which will send the page to a
printer - I've seen them before but can't find anything about printing in
any of my books on Javascript. Anyone know how to do that?
-
onClick="window.print();"
-
Put the following code within your tag:
<!-- Print and close button functions -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function setVariables() {
imgwidth=100; // logo width, in pixels
imgheight=19; // logo height, in pixels
if (navigator.appName == "Netscape") {
horz=".left";
vert=".top";
docStyle="document.";
styleDoc="";
innerW="window.innerWidth";
innerH="window.innerHeight";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}
else {
horz=".pixelLeft";
vert=".pixelTop";
docStyle="";
styleDoc=".style";
innerW="document.body.clientWidth";
innerH="document.body.clientHeight";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
}
}
function checkLocation() {
objectXY="printing";
var availableX=eval(innerW);
var availableY=eval(innerH);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
x=availableX-(imgwidth+10)+currentX; // Button position
y=availableY-(imgheight+50)+currentY; // Button position
evalMove();
setTimeout("checkLocation()",10);
}
function evalMove() {
eval(docStyle + objectXY + styleDoc + horz + "=" + x);
eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}
// End -->
</SCRIPT>
</head>
Add this within your body:
<body onload="setVariables(); checkLocation();">
<!-- Used for Print and
Close -->
<div id="printing"
style="position:absolute;
visibility:show;
left:-5000px;
top:-5000px;
z-index:2">
<table width=10 bgcolor=#ffffff><td>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (window.print) {
document.write('<form bgcolor=#000063 color="#000063"> '
+ '<input type=button name=print value="Print" class="ScreenOnly"'
+ 'onClick="Javascript:window.print()"> '
+ '<p></p>'
+ '<input type=button name=print value="Close" class="ScreenOnly"'
+ 'onClick="Javascript:window.close()">'
+ '</form>');
}
// End -->
</script>
</td>
</table>
</div>
This will create 'Print' and 'Close' buttons. These buttons float at the
lower right hand edge of the screen, you can change the button positions by
changing the x and y values.
wdvlTalk Roundup August 2002 Page 30
wdvltalk Roundup
|