Click to See Complete Forum and Search --> : Alert boxes (Message boxes) in JavaScript
hypnos
Jan 2nd, 2001, 01:31 PM
Hello Friends!
I have a Bob Marley web site named Bob Marley Mania (http://bobmarleymania.cjb.net/) The site was designed for Internet Explorer and doesn't work as well with Netscape Navigator. For this reason I added a little JavaScript message for those who are using Netscape basically telling them to use IE (sorry Netscape users).
At the moment my message box has this text in the title bar "Alert". Is it possible (like it is in VB) to change the text in the title bar? Thanks for reading.
Not sure if VBScript works in Netscape, but try it.
<Script Language="VBScript">
Msgbox "This page is best viewed with IE.",64,"So use it!"
</Script>
Mark Sreeves
Jan 3rd, 2001, 03:33 AM
You should try and make you website Netscape compatable, or at least offer reduced functionality.
here's a modified version of a login page I wrote for a very complicated web based app I wrote.
I used the ScriptX component to control printing and this only works on IE4 or higher...
<HTML>
<head>
<!--
this is the initial logon page
If the user's brOwser does not support Javascript, access is prevented.
it also detects the browser and suggests better alternative if nescsary
-->
</head>
<BODY bgcolor=#ffffff>
<SCRIPT LANGUAGE="Javascript">
<!--
document.writeln("<center>");
document.writeln("<h3><BR>Welcome to XYZ</H3><BR>")
// detect browser and advise..
var app = navigator.appName;
var ver = navigator.appVersion;
var i;
document.write("<small>You are using " + app + " version " + ver + "<BR>");
if(app == "Microsoft Internet Explorer")
{
var subVer = "";
var s = ver.indexOf("MSIE")
if( s > 0)
{
s+=5;
for(i = s ;i < s + 4;i++)
{
subVer += ver.charAt(i);
}
}
if(subVer < 4.01)
{
document.write("Using version 4.01 or higher will enable enhanced printing functions")
}
}else if(app == "Netscape")
{
if(ver.charAt(0) < 4)
{
document.writeln("Please use Version 4 or higher.<BR>")
}
document.writeln("Although this system can be viewed with Netscape,<BR>using Microsoft Internet Explorer version 4.01 or higher will enable enhanced printing functions")
}else{
document.writeln("This system has not been designed for your browser.<BR>")
document.writeln("Although this system can be viewed with Netscape,<BR>using Microsoft Internet Explorer version 4.01 or higher will enable enhanced printing functions")
}
document.writeln("</small>");
document.writeln("</center>");
document.write("<!--");
//-->
</script>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100% HEIGHT=100%>
<TR>
<TD VALIGN=CENTER ALIGN=CENTER>
<B>
Welcome to the xyz<BR><BR><BR>
<HR WIDTH=50%>
<FONT FACE="Arial" SIZE=3 COLOR=#FF0000>Javascript is NOT Enabled.</FONT>
<HR WIDTH=50%>
</B>
<BR><BR>
<B>
This site makes extensive use of Javascipt.<BR>
In order to access it please make sure
you have this option enabled and then reload this page
</B>
</TD>
</TR>
</TABLE>
<SCRIPT LANGUAGE="Javascript">
<!--
document.writeln("//--\>");
//-->
</SCRIPT>
</BODY>
</HTML>
hypnos
Jan 3rd, 2001, 01:10 PM
Thanks for the help guy although I'm not really interested in VB Script 'cos I think JavaScript is much better.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.