html course, website building, perl scripting, mysql databases, web site builder, build a website

  

 



Testimonial

Hey Dave:

You are brilliant! I was skeptical when I reviewed Instant Site Maker. I mean, I am a professional Webmaster after all. The first thing I noticed was the simplicity of your tool. Just plug in the info and walla, a gorgeous web page. I'll be using this on my next mini-site project. Thanks for bringing Instant Site Maker to market. You've made my life easier and probably for thousands of others!

Jim Mandich, Storm Golf

javascript



JavaScript is a scripting language, it is client side based (i.e. it runs on the visitors browser) as opposed to server based (like Perl) which runs on your server.

Remember JavaScript ISN'T Java while they have similar names they are completely different.

JavaScript can be used for many things including form validation, real-time changes to web pages and like the example below, for automatically sending email.

The following example generates a button on the page, similar to the newsletter sign-up page on this site.

When the button is clicked the script automatically simulates a mailto link being clicked on, reads the visitors default email address and puts the message in their outbox.

If their mail program is set up to send mail immediately the message will be sent straight away.

JavaScript Code:

<script language="javascript">
<!-- Hide from old browsers
function scramble(){
var p1,p2,p3,p4,p5,p6
p1='action="mai'
p2='first_part_of_your_email_address'
p3='">'
p1+='lto:'
p2+='@'
p5='</a>'
p6='first_part_of_your_email_address'
p2+='youremaildomain.com?your subject message ENCTYPE="text/plain"'
p4=p6

document.write("<form NAME=\"signup\" METHOD=\"post\""+p1+p2+"><input type=\"submit\" name=\"submit\" value=\"Click here to sign-up for our free newsletter\"><\/form>")

}

scramble()


//-->
</script>

All you need to do is enter your own details, if your email address is john.doe@abcxyz.com then p6 would have the value john.doe, p2 would be abcxyz.com?your subject message ENCTYPE="text/plain

p4 holds the same details as p6

That's it! Place the code on your page at the point you want the button to appear.

If you want to learn more about JavaScript check out this excellent resource, JavaScript for the World Wide Web. It's a great book full of tips, code and examples.

There's an accompanying web site where you can download the code examples from which makes thinks a lot easier!

 




Main Menu

web site tools
build a website blog
html help
html redirect
html marquee
html form
instant site maker
simple style sheet
is your site on life support
internet marketing
meta tags
perl cgi
javascript
javascript display date
email filters
simple email form
protect your code
disable right mouse
help visitors bookmark your site
free hosting vs paid
accept credit card payments
card payments using clickbank
newsletter
sep 29 newsletter
oct 10 newsletter
oct 24 newsletter
what is bandwidth
how much web space
contact us
resources
link to us
Links Directory

 

 

© All rights Reserved. No part of this site may be reproduced or copied without permission of the owners.
Site Directory