隐藏图像为链接的电子邮件地址 [英] Hide email address with image as link

查看:61
本文介绍了隐藏图像为链接的电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此javascript隐藏网站上的电子邮件地址

正常工作:

------------- --------------------

< p>将您的意见和问题发送至我们的


< script language = javascript>


<! -


var contact =" Newsletter Editor"


var email =" news"

var emailHost =" netmechanic.com"


document.write ("< a href =" +" mail" +" to:" + email +" @" + emailHost +

">" + contact +" ;< / a>" +"。")


// - >


< / script>


< / p>

------------------------- --------

如何创建图像而不是文本作为链接来启动这个

脚本?


提前致谢

解决方案

H ornyLaBelle在3/9/2006上午6:42发表以下内容:

我正在使用这个javascript隐藏网站上的电子邮件地址
工作正常:


不,你认为它运作正常。

-------------------------- -------
< p>将您的意见和问题发送至我们的

< script language = javascript>


< script type =" text / javascript">

<! -


放弃隐藏脚本的错误概念。

var contact =" Newsletter Editor"


var emailHost =" netmechanic.com"

document.write("< a href =" +" mail" +" to:" + email +" @" + emailHost +
">" + contact +"< / a>" +"。")

// - >


删除隐藏的脚本,它不再需要了,在某些情况下实际上可以实现

伤害。

< ; / script>

< / p>
----------------------------- ----
如何创建图像而不是文本作为启动此脚本的链接?




而不是变量联系方式,你会写出一个img标签。


-

兰迪

comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组每周

Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /


HornyLaBelle写道:

我正在网站上隐藏电子邮件地址用这个javascript


Utter废话。

工作正常:




不,它确实没有。

PointedEars


< p>将您的意见和问题发送至我们的
< ; script language = javascript>
<! -
var contact =''< img src =" gfx / some_image.png" alt =" email me">''
var email =" news"
var emailHost =" netmechanic.com"
document.write("< a href = " +" mail" +" to:" + email +" @" +
emailHost +
">" + contact +"< / a>" +"。")
// - >
< / script>
< / p>




I''m hiding the email address on a website with this javascript which
works fine:
---------------------------------
<p>Send your comments and questions to our

<script language=javascript>

<!--

var contact = "Newsletter Editor"

var email = "news"

var emailHost = "netmechanic.com"

document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+
">" + contact + "</a>" + ".")

//-->

</script>

</p>
---------------------------------
How can I make an image instead of the text as a link to start this
script?

Thanks in advance

解决方案

HornyLaBelle said the following on 3/9/2006 6:42 AM:

I''m hiding the email address on a website with this javascript which
works fine:
No, you just think it works fine.
---------------------------------
<p>Send your comments and questions to our

<script language=javascript>
<script type="text/javascript">
<!--
Drop the ill conceived notion of hiding scripts.
var contact = "Newsletter Editor"

var email = "news"

var emailHost = "netmechanic.com"

document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+
">" + contact + "</a>" + ".")

//-->
Drop the hiding scripts, it isn''t needed anymore and can actually do
harm in some circumstances.
</script>

</p>
---------------------------------
How can I make an image instead of the text as a link to start this
script?



Instead of the variable contact, you would write out an img tag.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


HornyLaBelle wrote:

I''m hiding the email address on a website with this javascript
Utter nonsense.
which works fine:



No, it does not.
PointedEars


<p>Send your comments and questions to our
<script language=javascript>
<!--
var contact = ''<img src="gfx/some_image.png" alt="email me">''
var email = "news"
var emailHost = "netmechanic.com"
document.write("<a href=" + "mail" + "to:" + email + "@" +
emailHost+
">" + contact + "</a>" + ".")
//-->
</script>
</p>





这篇关于隐藏图像为链接的电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆