http://www.jlid.net/home/software/_javascript_/safe-e-mail.aspx
I'll quote myself:
"Essentially, something like:
<s user="james" domain="domain.com">Email me!</s>
Is rendered by the browser as if it were:
<a href="" href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]">Email me!</a>"
Cheers
J
On 13/06/06, James Laugesen
<[EMAIL PROTECTED]> wrote:
Hi Al, something like this:
function safeEmailBold(name, domain, boldDisplay, normalDisplay)
{
var emailLink='<a href="" name +'@'+ domain +' class="EmailLink">';
emailLink+='<b>' + boldDisplay +'</b>'+ normalDisplay;
emailLink+='</a>';
document.write(emailLink);
}
But you inspired me to write a "nicer" solution so I'll post a link to that in a minute when I've finished.
J
On 13/06/06, Al Kendall <[EMAIL PROTECTED]> wrote:Thanks James,
Being very new to _javascript_ I have little idea on how to accomplish your
sujestion. My aim is to have just the surname bold. (ie: BUCHANAN)
You sujest I add css to the safemail function. The only css I can add to it and get working
bolds the who name (surname, christian & nick name) [see sample script] If you can
show me how I can just have the surname bold i'd appreciate it others wise I'll have to try
something else.
function safemailbold(name, domain, display) {
displayed=(typeof(display)=="undefined") ? name+"@"+domain : displaydocument.write('<a href="" + name + '@' + domain + ' class="bold">' + displayed + '</a>');
}
Cheers!!
AlOn 6/12/06, James Laugesen < [EMAIL PROTECTED]> wrote:Hi Al, it doesn't make sense to be performing formatting inside the script like that, think about what you're really trying to acheive.
I'd at least do something like:
safemail('shirazman',' hotmail.com','BUCHANAN', 'Mark (Buck)')
and the safemail function does semanticly nice html, with css for the bold'ness.
JOn 12/06/06, Lachlan Hunt <[EMAIL PROTECTED]> wrote:David Dixon wrote:
> Hi Al,
>
> Someone might be able to correct me, if my info is not totally accurate,
> but if memory serves the following applies:
>
> The <b> tag is deprecated in XHTML 1.0, and not allowed in strict
No it is not deprecated. It is declared in the XHTML 1.0 Strict DTD.
http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-strict.dtd_b
> The <strong> tag is perfectly valid in XHTML, but in strict, it cannot
> be a direct child of the body tag, nesting it in a div/span/p etc though
> should be fine.
That is not the problem, the problem is the way in which it is used
within the script element.
This explanation applies to HTML:
http://www.htmlhelp.com/tools/validator/problems.html#script
For XHTML, you need to use a CDATA section as I explained in my previous
post. For backwards compatibility (i.e. serving XHTML as text/html) you
should use a combination of both techniques)
--
Lachlan Hunt
http://lachy.id.au/
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************
--
Cheers!
Al Kendall
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************
