Hello, Script Tip Folk...
Let's start looking at a new script. This
is a little more involved than the last one, so we should be able to
really tear it apart and get a lot out of it.
Basically, here's what this script does:
That said, here's what it looks like:
Basically, here's what this script does:
- Posts a dialogue box when a person enters the page.
- The box has text on it that can be altered.
- The box gives the user the opportunity to click OK to enter the page or Cancel not to enter the page.
- If the user clicks OK, then the page loads as usual.
- If the user clicks Cancel, then the script reloads the page the user was coming from.
That said, here's what it looks like:
<SCRIPT LANGUAGE="javascript"> function JemWebCONFIRM() |
{if (!confirm ("YOUR MESSAGE GOES HERE")) |
history.go(-1);return " "} </SCRIPT> |
How about that? All that functionality in such a small script!
We'll start tearing this pup apart by looking at the very first line in the script:
By using the LANGUAGE attribute, you specifically lock in which script type you're using. It can be quite beneficial to the browser if the script you're using has commands found in different scripting languages.
So use it!
Tidak ada komentar:
Posting Komentar