Simple E.Mail Form
You can have an e.mail form on your website that does a lot of the 'filling in' for you! This way you can have a pre-determined 'subject' line if you want.
You have the choice here of a text link or a button, it's up to you! You will have noticed that the Javascript prompts you for a couple of inputs. They are highlighted in blue which means you can click OK to carry on, or over-type the line with whatever you want.
Once you have clicked OK after the last prompt your e.mail system is automatically started and the lines have been filled in for you. All you have to do then is type in the 'Body' part with what you want to say!
The code for this is as follows:
<script>
mailsys="Outlook Express mail";
var author="Allan";
if (author == "Allan"){
phrompt=prompt;
snarkconf=confirm;
}
function mailsome1(){
who=phrompt("Destination email address: ","tacticalpanda.websites@virgin.net");
what=phrompt("Enter the subject: ","About this Javascript stuff");
if (snarkconf("Are you sure you want to mail "+who+" with the subject of "+what+"?")==true)
{
parent.location.href='mailto:'+who+'?subject='+what+''; }}
</script>
<a href='javascript:mailsome1()'>E.mail me!</a>
<form><input type="button" value="Click here to start!" onClick="mailsome1()"></form>
To use a text link, delete the green line. To use a button link, delete the pink line. Remember, the red words can be replaced with your own.
There is one other way of putting in pre-determined lines in an e.mail which is not Javascript, but could be useful all the same.
Let's say you want to have your visitor send you an e.mail just to say they have visited your website and they like what they saw. Okay, let's get them to send you a message saying just that!
Click here to see what I mean.
The secret is in the script - as always! An ordinary 'mailto' script looks something like this:
<a href="mailto:tacticalpanda.websites@virgin.net">e.mail me!</a>
Okay so far? Now we can add a pre-determined subject like this:
<a href="mailto:tacticalpanda.websites@virgin.net?subject=What I want the subject to be">e.mail me!</a>
You will have noticed that the additional parts (the subject) has been highlighted in red.
Finally we add the 'body' part.
<a href="mailto:tacticalpanda.websites@virgin.net?subject=What I want the subject to be&body=The body of the text goes here!">e.mail me!</a>
...and that's it! Be careful of two things.
- Don't put too many words in the body section, keep it short and sweet, otherwise it won't work.
- Don't try to put silly words in other peoples mouths that they don't want to say, otherwise you will not get the e.mail!
I would suggest that you keep the 'Body' to something like 'please forward me more details', or something like that.
Top
Date Last Updated Script
Here is a 'date last updated' script that shows you visitors when the page was - um, last updated!
This page was
This is a 'fire and forget' script in that it never needs to be looked at once it is in place. Here's how it looks:
<CENTER>This page was
<SCRIPT LANGUAGE="JavaScript">
var dateMod = "" ;dateMod = document.lastModified ;document.write("Last updated: "); document.write(dateMod); document.write();
// --></SCRIPT>
</CENTER>
That was easy wasn't it? All you have to do is copy and paste these few words where you want it to appear and that's it! You can add your own prefix or suffix around the Javascript as I have at the bottom of this page (added the copyright message before the words 'Last updated...).
Top
Close Window Script
Let's start by opening a new window - after you have read the following instruction, click here. You will see a single line of text with a link saying 'This window can be closed by clicking here...', all you have to do is click it and the browser closes - easy!
A lot of people use this script and it's so easy to install and use. Simply place the following coding where you want it to appear on your page:
This window can be closed by <a href="javascript:window.close()" title="Click here to close this window!">clicking here</a>
The parts in red can be changed to read whatever you want.
Top
(Annoying) Dotted lines...
Not exactly Javascript, but useful all the same. Have you ever noticed when you click on a link, and then go back to it, the link has an annoying little dotted line 'box' around it? Not sure what I mean? Click this link, it will open a small box which you can easily close again. Then look again at the link. Not only has it changed colour, which it's suposed to, but it has that silly 'dotted line box' around it.
So how do you get rid of it? Here is the original code for the new mini-window:
<a href="example1.html" title="Click here" onclick="NewWindow(this.href,'name','450','200','yes');return false">Click this link</a>
Now let's add a simple sentence - onfocus="this.blur()"
So that it now reads:
<a href="example1.html" onfocus="this.blur()" title="Click here" onclick="NewWindow(this.href,'name','650','450','yes');return false">Click this link</a>
The new link is now - Click this link.
Open the window again, then close it. Notice the difference? No dotted line around the link. I know it's only aesthetics, but I think it's a great idea and it can be used just about anywhere where you have a link - buttons, e.mail forms, checkboxes, radio buttons, graphics and so on.
How about a Print Button Script and a Password Protection Script? Click here!
Top
[1] [2] [3] [4] [5] [6] [7] [8]
<<< Previous page
|