Forum Moderators: open
<a href='javascript:beat'>Email Me</a>
Like I said, the code itself is very long, so I want to make a seperate file with just the code (say, 'mailcode.htm'), and link to that. So my question is, what do I insert into the "href='javascript:beat'" in order to referance the script externaly?
<SCRIPT LANGUAGE="JavaScript" SRC="file.js"></SCRIPT> for external file.js. Don't put the js tag in the external file, just the js code.
Had to edit: I misunderstood the question. Sorry, I only know the above code is used to access external js. Not sure it will work in this case.
That seems to be the format:
<a href="#" onclick="javascript:functin()"> <SCRIPT type="text/javascript" SRC="file.js"></SCRIPT> @language is deprecated in favour of @type.
<a href="#" onclick="functin()"> You don't need the javascript: pseudoprotocol if you're calling a function from an event handler.
The problem with images is severalfold. One, most spambots look for 'mailto:' in site sources, so an image won't help much, unless of course you don't link to it. Beyond that, simply the issue of using an image in a way that it can flow with the text.
The code I'm refering to hides the e-mail address, but when the link is clicked, it acts as a mailto: command.
Anyways, thanks!
I use an external JavaScript function to write the mailto: links to the page with a backup of an image for those with no JavaScript, and so far that address has not been spammed.
For browsers without javascript, use an unlinked image that contains a visual rendition of the email address. Users will just have to re-type that to send mail.