|
-
Sep 22nd, 2000, 02:01 PM
#1
Thread Starter
Frenzied Member
I have absoulutly NO clue on VB script, I would apprecitate it if someone can give me code for my website so that when the page loads, a messagebox comes up saying "Hello and Welcome to my Website" then they click OK and then another message box comes up saying "The last update was held on 9/23/00" then they click ok, and the brower window closes, please give me complete source on how to do this.
I dont even know how to do somehting like <lan id= vbscript> is that correct? if not please tell me how to do that
thanks in advance
Dimava
NXSupport - Your one-stop source for computer help
-
Sep 22nd, 2000, 03:09 PM
#2
Hyperactive Member
Without you knowing vbscript, the only advice I can give you is go here:
http://splendor.unibe.ch/programming/vbs/vbshtml.htm
A tutorial on vbscript for html.
Other than that, perhaps Javascript?????
Sorry!
Lee
 Mahalo 
VB6(SP5), VC++, COBOL, Basic, JAVA
MBA, MCSD, MCSE, A+
Computer Forensics
-
Sep 22nd, 2000, 03:11 PM
#3
Fanatic Member
Just do a msgbox:
Code:
Msgbox("Hello world!")
To add vbscript to an html file, you can use the Activex Control Pad from Micro$oft:http://www.mediabuilder.com/462.html
-
Sep 22nd, 2000, 05:41 PM
#4
Why don't you just use Javascript?
Code:
<SCRIPT LANGUAGE="JavaScript">
alert("Hello World!")
</SCRIPT>
-
Sep 22nd, 2000, 05:44 PM
#5
Thread Starter
Frenzied Member
thanks guys, I would rather user VB becuase I haven't start learning JAVA yet, and I'm more comfortable with VB. Once again, thanks guys
NXSupport - Your one-stop source for computer help
-
Sep 22nd, 2000, 05:47 PM
#6
Actually, it is:
msgbox("Prompt", paremeters(the same as VB), "Title")
JAVASCRIPT can only display ALERT & CONFIRM
-
Sep 22nd, 2000, 05:53 PM
#7
Thread Starter
Frenzied Member
would this work in VB Script:
Code:
Dim inta as integer
inta = MsgBox ("Do you Like my website", VbYesNo, "WAZZZZUP")
if inta = 6 then
MsgBox "Thanks, I'm glad you like this"
Else
inta = 7 then
MsgBox "Whats wrong with it?, email [email protected]"
end if
end if
NXSupport - Your one-stop source for computer help
-
Sep 22nd, 2000, 05:57 PM
#8
Ok. Calm down...it was just a suggestion.
I guess VB Script would be better since you can have the icon you choose and the title you want. And Javascript doesn't have that option.
-
Sep 23rd, 2000, 01:42 AM
#9
Hyperactive Member
Here is how you would do what you want in vbscript:
Code:
<html>
<head>
<script language="vbscript">
sub MSG()
'All variables are variant type. If you need a particular
'type of variable, you have to use one of the follow functions
'to convert type: CStr, CLng, CBool, CInt (I think this is right).
Dim lret
lret=msgbox("hi, you are at my site.", vbokcancel, "MY Site")
if lret=1 then
msgbox "document was last modified: " & document.lastmodified
end if
end sub
</script>
</head>
<body onload="MSG()">
hi
</body>
</html>
As to your last question. You cannot close the parent window of a webbrowser, without the users explicitly allowing it. The command you would use is:
Code:
self.close 'or document.close
If you try this in the parent window, an alert message will be displayed to the users warning them that a script is trying to close their browser. However, if this is on a child window (a new window spawned by the webpage), then you can use the method above to automatically close it.
Now remember, this will only work in IE, so if you are looking for cross browser compatibility, you would want to change it to javascript, like this:
Code:
<html>
<head>
<script language="javascript">
function MSG() {
var lret;
lret=confirm("hi, you are at my site.","MY Site");
if (lret){
alert("document was last modified: " + document.lastModified);
}
}
</script>
</head>
<body onload="MSG();">
hi
</body>
</html>
I personally always use either javascript or php, because I know that most browsers can handle it in some form or another. Anyway, just my 2 cents. Hope this helps.
-
Sep 23rd, 2000, 03:03 AM
#10
Frenzied Member
The msgbox function is not available in client side VBScript. Only on the server side where it is undesirable to have a modal dialog pop up. (And pointless since nobody's there to read it)
You have to use window.alert. The syntax is pretty much the same in VBScript as it is in Javascript.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|